Invert light direction for the back side outside shader code

Ok, got on the right track on this one as well by my own, making vec3 normal = - normalize(vNormal); in the normal_fragment_begin chunk, based on this post. Basically I’m just flipping the normals of the back side rendered material so that the material is lit just as if it was rendering its front side, while still rendering its back side.

I imagine this small change in the shader doesn’t flip the faces or geometry (like for other non-shader methods) and it isn’t affected by transformations on the object (like those of TransformControls, for example).

Other than that, I like how things work on this forum: I get no replies to my questions, while answering my own ones … and those of others in the meantime (well, at least the objective is achieved, so I guess it’s not that bad). :rofl:

1 Like