ソースを参照

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 5 日 前
コミット
64b98ea813

+ 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
 * Egg: Add limited forward compatibility for metallic-roughness textures
 * OpenGL: fix error blitting depth texture on macOS (#1719)
 * OpenGL: fix error blitting depth texture on macOS (#1719)
 * OpenGL: fix SSBO support not being detected in certain situations
 * 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)
 * X11: Add config variable to enable detection of autorepeat key events (#1735)
 * GUI: Fix bug with PGSliderBar dragging (#1722)
 * GUI: Fix bug with PGSliderBar dragging (#1722)
 * Minor thread safety things for free-threaded Python builds
 * 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) {
         else if (noprefix.compare(7, string::npos, "Height") == 0) {
           bind._part = Shader::STO_stage_height_i;
           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;
           bind._part = Shader::STO_stage_selector_i;
         }
         }
         else if (noprefix.compare(7, string::npos, "Gloss") == 0) {
         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_normal_gloss,
 
 
     M_emission,
     M_emission,
+
+    // Forward compatibility alias.
+    M_metallic_roughness = M_selector,
   };
   };
 
 
   enum CombineMode {
   enum CombineMode {