Normal map on NodeMaterial not shown

The exported code variant does not show the normal Map. I tried doing the embedded texture json version, that one does work. But I would prefer to use the extracted code version.

Only thing that I’m doing is Normal Map -> Perturb Normal -> Insert as world normal into the reflection texture.

A demo of the issue: Babylon.js Playground

The material is made here:
Here is a version with embedded materials:

It is actually not a bug :slight_smile:

The mirror texture does not use normal to render its reflection (the other example you shared inside NME is using equirectangular projection WHICH uses normals :))

Hey @Deltakosh thanks for taking your time looking at my issue. I think I don’t understand. What does a texture have to do with normals? Wont the texture being used inside the shader use equirectangular projection since it’s in the NME?

Reflection (depending on the mode) can use normals

But now I get the problem, which version of nme did you use to generate your PG? It should have generated a line to configure the reflection texture coordinate mode:

Reflectiontexture.texture.coordinatesMode = BABYLON.Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE;

But this won’t work with mirror texture (as I told you they do not need normals to compute reflection). What you need is probably to add a light node to include your perturbed normals :slight_smile:

I ended up going for a PLANAR_MODE solution in the end. Thanks for the tip @Deltakosh, helped me get back on track. The coordinates mode is not generated in the code version when I don’t embed a texture. Not sure if that’s by design but it might be part of why I was so confused.

This is by design as the coordinateMode is hold by the texture