So I’ve created a buffergeometry and applied a doublesided white meshStandardMaterial. Then I added a light to the scene and it seem like the back side of the geometry is not receiving any light even though it is directly exposed to the light source.
Note:
Helper with white lines is the helper for a SpotLight
Helper with orange lines is a helper for a secondary camera.
I think I know what the problem is now. My BufferGeometry was indexed. Since a single instance of every vertex exist and these vertices’ normals only points to a single direction, that’s why the light is only reflected on one side.
Every normal points in the same direction on a plane. That is, orthogonal to the plane facing forward.
What you explained wouldn’t cause this behavior, because the backface normals are inverted on rendering time inside the shader. Make sure it works correctly for FrontSide material and it will work correctly for DoubleSide. JSFiddle
Without any live examples, I’m afraid it won’t be possible to help you more than this.
Unfortunately I can’t share the code here. “Can’t” meaning I’m not allowed to.
Although I have new findings
Seems like the normals are normal. If I move the light under the mesh. It does light the mesh.
Light placement 1
Light placement 2 (Below mesh)
The weird thing is, if the light is on top, the light only affects the “top” side of the mesh even though it is posed in a way that the “bottom” side should be hit by the light
I added VertexNormalsHelper and it all makes sense now. Seems like the normals are nailed to the object’s original spot. It is shown in this screenshot. Take note that I am calling the helper’s update() function on every render but the normals’ position are not updating on the view. Why is it behaving this way?
@bumblebijan can’t you create a simpler version of your code in a live example?
Perhaps just altering a default PlaneBufferGeometry in a similar way that you are updating it in this project. Don’t need to involve the complex curved path you are doing, just something minimal that would replicate your problem.
It’s really hard to debug what’s going on this way, and this is reaching a point where my knowledge falls short.