Search code examples
three.jsnormalsvertices

Normals generation and DoubleSided attribute in a material in Three.js


I'm generating the normals of a model (planes) and I'm using the side : THREE.DoubleSide attribute in my material to have Three.js render both faces.

I want to know what happens to the generated normals when this attribute is set.

Are they duplicated and flipped for the other side (in the shader maybe) ?

Or maybe nothing happens, so I have to generate the model's other faces' vertices by hand (which would mean that this attribute is useless in my case...) ?

Thanks for any help.


Solution

  • Normals were not generated correctly. This fixed the issue.

    I guess the lighting shader just flips the normals before processing the backSide as opposed to the frontSide.