I’m currently working on shaders and I’ve seen that I can use GeometryBuffer to get a normal sampler but the result does not correspond to the normals (as you can easily see on the cubes) :
The thing i don’t understand is why I can’t see the edges on the cubes.
Even if I’m in the bad space, shouldn’t I see the separation between the different faces (instead of a gradient)?
Note: I wrote something wrong beucase I’m tired: you translate to world space in my example
That’s not a need. In some effects you need view space normals, and others you need world space normals
In the case of Babylon.js it is in view space by default so you have to translate to world space in your case.
In the case of SSAO2, it uses normals in view space to reconstruct tangents etc. Babylon.js/ssao2.fragment.fx at master · BabylonJS/Babylon.js · GitHub
If I understood you correctly, I should change my space reference, but even if I’m not in the world space, shouldn’t I have the same color on each face of the cube?