(I tried to create a Playground to show this issue but was running into CORS issues trying to load an external GLB file )
The lighting is on the wrong side of the reflected mesh — this seems to only happens w/ loaded meshes. Specifically GLB meshes (which is the only type I’m using). When I look at both sides of a GLB mesh I can see that the light source in the reflection is coming from the opposite direction(s). (I’m using a DirectionalLight)
Hopefully the screenshots below explains the issue better!
I also decided to try out a loaded OBJ mesh to see if it was the same issue — but it seems the OBJ has no reflection at all?
Please let me know if there’s anything I can try, to fix this on my end. Thanks!!
GLB Front Side View — Lighting on wrong side of GLB mesh
GLB Back Side View — Lighting on wrong side of GLB mesh
OBJ Example — No reflection
Hey @sebavan, I saw you were helping with another MirrorTexture bug. Do you happen to know anything about this issue I’m running into?
obj are using an additive reflection, so black would not be visible cause not added.
In pbr reflection is controlled with metalness but the highlights would not reflect as a symetrical value. They would only be where the light hits the faces which could be what you are experiencing in the first case.
A repro would really help to ensure it is what is happening.
Thanks for getting back to me!
Here’s a repro — https://playground.babylonjs.com/#B9UHX6
• Small box = Babylon
• Middle / Wood Box = GLB
• Other box = OBJ
The light is coming from one direction. All boxes are lit correctly. The reflection is correct for the Babylon mesh and OBJ mesh but not for the GLB mesh. As you rotate around the scene you’ll see that the light is hitting the opposite side of the OBJ mesh that’s being reflected.
Figured it out
I was able to fix it by setting:
material.twoSidedLighting = false
This made me realize that this comes directly from Blender. So if anyone else runs into this you can either modify the
twoSidedLightning property in Babylon or in your Blender material turn ON Backface Culling before exporting
Ohhhh yes this would not help