kandi X-RAY | ShadowMap Summary
kandi X-RAY | ShadowMap Summary
ShadowMap
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ShadowMap
ShadowMap Key Features
ShadowMap Examples and Code Snippets
Community Discussions
Trending Discussions on ShadowMap
QUESTION
As the title states, I am using es6 classes, but because they are all not modules apart from the main.js file, it makes it difficult to use API's because I cannot make use of import modules.
I used the code from this link's answer: How to add in Three.js PointerLockControl? and pasted the code into a js file, calling it up in my HTML, but I get an error stating:
Uncaught ReferenceError: PointerLockControls is not defined
It is not picking up the class when I reference it. I tried to link it to the GitHub raw code, and it didn't pick it up either.
This is my index.html code (only one line referencing the GitHub raw code):
...ANSWER
Answered 2021-May-26 at 18:31I changed all my es6 classes into es6 modules, and used import. I don't think there was a solution for this with cdn or raw git scripts.
QUESTION
I have uploaded a glb file with an animation, and the animation is moving extremely fast, and I do not know why.
This is my character's animation code:
...ANSWER
Answered 2021-May-24 at 21:38I think the issue is with your AnimationMixer.update()
call. If you look at the docs, update is expecting a time-delta in seconds, but it looks like you're passing the total running time. This means it should receive the time passed since the last frame. You can fix this by using clock.getDelta();
as the argument:
QUESTION
I'm trying to get some Morph Based Vertex animations going, but I'm getting #342 errors telling me that:
...ANSWER
Answered 2021-May-22 at 16:18Well don't I feel dumb, turns out the problem wasn't even in the shader files, but that I had made the type of "VSGetShader()" instead of "VSSetShader()."
Friendly reminder to all other novices: Remember to check if you really wrote "Set"...
QUESTION
I'm pretty new to threeJS and i wanted ton have the shadow of the torus to be casted on the PlaneGeometry behind it.
I tried to play with .castShadow
& .receiveShadow
but with no result
Could you explain what I did wrong ?
...ANSWER
Answered 2021-May-12 at 13:33You have used MeshBasicMaterial
for your plane mesh which is a unlit material. So it does not receive shadpws. Using a lit material like MeshStandardMaterial
solves the issue.
QUESTION
I'm diving into the world of threejs. I have taken one of the example projects and modified it. I just added a few cube geometries with color on it. The problem is, the cube geometry shows with no edges. You cannot distinguish where the faces end, its all bleached out. Not sure if this is a lighting issue, or material issue. My code is below.
...ANSWER
Answered 2021-May-04 at 16:06You have to use a lit material (like MeshPhongMaterial
) for your boxes. MeshBasicMaterial
is an unlit material and does not react on lights. Also using an ambient light next to your directional will make the scene look more natural.
QUESTION
Im having quite a bit of trouble adding an environment map to a loaded GLTF / GLB file, as of now I get some sort of reflection instead of a black dot with a light point on it,
I was reading a bit of the document for three js and think I can pull it off with the standardmeshmaterial and applying it somehow to the object(gltf) and adding the mesh into the scene. I tried a similar mockup but the item disappears. I dont know how to go about it, help guys.
This is the environment map im trying to apply to it, (or something similar) https://hdrihaven.com/files/hdri_images/tonemapped/8192/venice_sunset.jpg
here is the codepen I am working on https://codepen.io/8AD/pen/XWpxmpO
HTML
...ANSWER
Answered 2021-Apr-21 at 07:53You have to include RGBELoader
into your app for importing HDR textures and make use of PMREMGenerator
in order to pre-process the environment map for the usage with a PBR material.
QUESTION
So im working on a website for a client and want to move a script that i've built in codepen into a div container in html elementor, everytime i add it into the website (elementor) it places the window at the bottom of the page and not into the container.
Update
Trying to move JS into a Div container to add to specific part of website, would a document.getElementById
work? and how should i go about it??
I've tried to add it within the web builder via wordpress but when i attach the JS via elementor, it takes the script and applies / views it on the bottom of the page under the footer, I just want the script to be viewable in a specific section.
HTML
...ANSWER
Answered 2021-Apr-20 at 03:25If you're wanting to make the threejs canvas appear inside a div, you have to change where the canvas appears in the DOM. This is done in Threejs using the renderer.domElement
QUESTION
I've been following some tutorials to make this simple sandbox with a test .glb file.
https://codesandbox.io/s/zen-black-et9cs?file=/src/App.js
Everything seems to work except the shadows. I can't find any missing castShadow/recieveShadow/shadowMap declarations anywhere... just not sure what I'm missing.
Thanks if you can point to my mistake!
...ANSWER
Answered 2021-Apr-18 at 06:21I figured it out - it was the shadow-mapSize-width and height. 1024 wasn't enough, I had to bump that number much bigger (works at 10240). Not sure why this is the case, perhaps my imported model is of a different scale or something. But it works now!
QUESTION
I want to implement selective bloom for an imported GLTF model in ThreeJS using an Emission map.
To achieve this I am supposed to first make the objects that should not have bloom completely black and using the UnrealBloomPass and the ShaderPass I'm going to mix the bloomed and non-bloomed effect passes together somehow.
I need to use GLSL code, which I'm only barely familiar with. Here is my basic setup:
...ANSWER
Answered 2021-Apr-15 at 17:32The order for selective bloom is still the same:
- Make all non-bloomed objects totally black
- Render the scene with bloomComposer
- Restore materials/colors to previous
- Render the scene with finalComposer
Patch model's material, having a common uniform, that indicates which render will be used:
QUESTION
In my project I want to display 3d objects which sometimes have small LED lights. The idea is, that these small lights need to be emitting some kind of bloom to make it look like they are glowing.
I've tried to apply the UnrealBloom however it is considered for the entire scene and not just for the parts that have the actual emission value (using an emission texture map).. the scene gets very blurry as well.
This is obviously not what I wanted. I only need the little red LED light bulp to glow not the entire object. However I have not yet found a way to tell the engine to only apply the bloom to where the emission map is pointing at.
I'm using a very simple code setup which is almost the same as the UnrealBloom Example:
How can I setup the emission texture correctly and make only the emissive parts of the object glow and prevent the unrealistically shiny surfaces and very blurry visuals?
UPDATE: Editable example of my setup is now available on JSFiddle!
...ANSWER
Answered 2021-Apr-09 at 14:30That official example is overcomplicated, from my point of view. But the concept of selective bloom itself is simple enough:
- Make all non-bloomed objects totally black
- Render the scene with
bloomComposer
- Restore materials/colors to previous
- Render the scene with
finalComposer
That's it. How to manage the darkening/blackening non-bloomed object and restore their materials, it's up to you.
Here is an example (which seems complex, but actually it's not that much):
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ShadowMap
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page