Mesh imported from glTF has flipped normals in G-Buffer normal texture

Hi,
I was trying to implement some post-processing effects using the normal texture from GeometryBufferRenderer and I came across this problem.

I created a new Mesh with the exact same data as in the imported mesh and in this case the normals appear as expected in the G-Buffer normal texture.

Here’s a playground example displaying the problem: https://playground.babylonjs.com/#DNL5D5

I also noticed when trying Babylon.js 4.1.0 in the playground the normals were as they should be. They are flipped in both 4.2.1 and 5.0.0.

cc @Evgeni_Popov or @CraigFeldspar

This PR will fix the problem:

2 Likes

Thank you for the quick response and fix!

Thanks !!!