Light on wireframes in DoubleSide - three.js

I can't get light on wireframes inside the geometry.
For example I create IcosahedronGeometry (MeshPhongMaterial) and set point light. When side is set to DoubleSide or BackSide, I can see light on the faces. But when I set on wireframes, then in BackSide there is light on frames, but in DoubleSide there isn't.
In my opinion in DoubleSide and wireframes there should be light seen on the frames inside and outside the geometry.

Related

Can I add an illuminating texture map to three.js material

I am new to three.js and I created a classic sphere, wrapped with a world color map & bump map and an alpha map for clouds, and directional sunlight. How can I now add an earth at night texture only on the shadow side of the globe? The globe is rotating, so I couldn't just create 2 half-spheres.
I tried adding this grayscale mask to the texture, but it is also visible in daytime. I then tried illuminating the map with a different light aimed at the dark side, but couldn't selectively target only one material. I didn't quite understand if I need to use "emissiveMap".
Could I shine a light through a semi-transparent map/mask from the center of the earth to make the cities visible, or is there some type of "black light" to only make selected color/map areas shine in the dark?
I don't need any glowing effects, I just want it to be visible. Will I have to create individual light points or learn to use fragment shaders?

three.js light leaking from object

I'm having an issue with three.js lighting. Not sure what am i doing wrong.
I have a plane that is set to receiveShadow to try and a cube that is set to castShadow. Overall all ok until I move the light into the cube. If the light is within 70% of the center of the cube, all good, no light comes outside but if within 30% of the cube's edged it's leaking light to ouside. Is this preventable?
What i mean is:
(this is ok)
this is not ok
Ok so I started reading a bit more about light properties and found out that in my case it was the following issue:
bulbLight.shadow.camera.near = 0.01;
Had to do with shadow camera frustrum. This fixed the issue. Now if the light is inside the cube (had to do with dimensions of the objects) it doesn't leak the light out. Practically speaking the light was never "fully inside" of my objects.

Light affecting all objects and passing through walls in three.js

I have a house scene where it has number of walls, when i add directional or spot lights the light passes through walls irrespective of the direction of light positioned.How can i make my light not to pass the wall ?
That is not a way how the WebGL 3D rendering works. All materials will be affected by light. You can render a shadows: http://learningthreejs.com/blog/2012/01/20/casting-shadows/
but, that means the light on the Meshes will be always rendered and after this will be rendered a shadow. That means, if you have a meshPhong material with a high shininess, it will be rendered visible and darkened by the shadow, which is not physically possible in real.

Light bleeding through objects

I probably miss some basic concept, because I tried all light forms and materials, but I can't stop the light going through the plane or vice-versa.
I'd expect that light from the pointlight source is stopped by the object, but it doesn't seem to be the case.
I'm such an idiot :)
Light source should be set to cast shadow. Plane should be set to cast shadow, box should be set to receive shadow.

A directional light doesn't adapt to the scale of a three.js object

I have a DirectionalLight as a child of a Object3D. When I set the scale on the object the light doesn't respond as I'd expect -- it casts a different shadow at a different depth. It's as though the light hasn't really been updated for the scale.
Is there something I must to do to get the light to properly scale?
DirectionalLights are not intended to be scaled -- or added as children of anything other than the scene.
three.js r.63

Resources