Light shining on the wrong side of the mesh?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Magso

I have an imported model which works fine however if I flip it by setting any of the scale axes to -1, all the lighting is shown on the wrong side of the mesh as though it’s flipping both the position of the lights and the environment with it so it’s rendering local to the mesh and not in global space. How could I fix this?

The problem seems to be with GLES3, switching to GLES2 fixes the problem. This might be due to GLES2 rendering the light on both sides of the mesh whereas GLES3 only renders the side supposedly facing the light, but doesn’t take a negative scale value into account but that still doesn’t fully explain why the lighting flips in GLES3.

Magso | 2019-03-28 20:49

:bust_in_silhouette: Reply From: Magso

The cull mode is set to disabled when importing meshes. Although it doesn’t explain why the light flips only in GLES3, making a new material and setting the cull mode to front or back fixes the issue.