PBR and the name of texture maps

There are predefined texture input names intended for PBR texture maps:

https://docs.panda3d.org/1.10/python/programming/shaders/list-of-glsl-inputs

There are a few undocumented, this is the full list:

uniform sampler2D p3d_TextureFF[];
uniform sampler2D p3d_TextureModulate[]; // default color: (1, 1, 1, 1)
uniform sampler2D p3d_TextureAdd[];      // default color: (0, 0, 0, 1)
uniform sampler2D p3d_TextureNormal[];   // default color: (0.5, 0.5, 1, 0)
uniform sampler2D p3d_TextureHeight[];   // default color: (0.5, 0.5, 1, 0)
uniform sampler2D p3d_TextureGloss[];    // default color: (1, 1, 1, 1)
uniform sampler2D p3d_TextureSelector[];
uniform sampler2D p3d_TextureEmission[];

The “selector” slot is intended for an AO, metallic, roughness map. This has the AO in the red channel, the roughness in the green channel, metallic in the blue channel, just like in glTF 2.0, and panda3d-gltf uses this slot for that purpose. This slot will be renamed accordingly in 1.11.

1 Like