Browse Source

GLSL: Add p3d_MetallicRoughnessTexture input mapped to M_metallic_roughness

This new M_metallic_roughness enum value is just an alias of M_selector
rdb 2 days ago
parent
commit
64b98ea813
3 changed files with 6 additions and 1 deletions
  1. 1 0
      doc/ReleaseNotes
  2. 2 1
      panda/src/glstuff/glShaderContext_src.cxx
  3. 3 0
      panda/src/gobj/textureStage.h

+ 1 - 0
doc/ReleaseNotes

@@ -13,6 +13,7 @@ This maintenance release fixes some minor defects and stability issues.
 * Egg: Add limited forward compatibility for metallic-roughness textures
 * OpenGL: fix error blitting depth texture on macOS (#1719)
 * OpenGL: fix SSBO support not being detected in certain situations
+* GLSL: Add p3d_MetallicRoughnessTexture input mapped to M_metallic_roughness
 * X11: Add config variable to enable detection of autorepeat key events (#1735)
 * GUI: Fix bug with PGSliderBar dragging (#1722)
 * Minor thread safety things for free-threaded Python builds

+ 2 - 1
panda/src/glstuff/glShaderContext_src.cxx

@@ -1015,7 +1015,8 @@ reflect_uniform(int i, char *name_buffer, GLsizei name_buflen) {
         else if (noprefix.compare(7, string::npos, "Height") == 0) {
           bind._part = Shader::STO_stage_height_i;
         }
-        else if (noprefix.compare(7, string::npos, "Selector") == 0) {
+        else if (noprefix.compare(7, string::npos, "MetallicRoughness") == 0 ||
+                 noprefix.compare(7, string::npos, "Selector") == 0) {
           bind._part = Shader::STO_stage_selector_i;
         }
         else if (noprefix.compare(7, string::npos, "Gloss") == 0) {

+ 3 - 0
panda/src/gobj/textureStage.h

@@ -65,6 +65,9 @@ PUBLISHED:
     M_normal_gloss,
 
     M_emission,
+
+    // Forward compatibility alias.
+    M_metallic_roughness = M_selector,
   };
 
   enum CombineMode {