Browse Source

pgraph: Sort alpha testing just after ShaderAttrib in comparison

In practice changing the AlphaTestAttrib mode requires the driver (or Panda) to modify the shader, and changing the reference alpha without changing the mode is pretty rare

Same applies to TransparencyAttrib, which may modify alpha test state
rdb 1 year ago
parent
commit
2f5eb8cf79

+ 1 - 1
panda/src/pgraph/alphaTestAttrib.h

@@ -76,7 +76,7 @@ public:
     RenderAttrib::init_type();
     RenderAttrib::init_type();
     register_type(_type_handle, "AlphaTestAttrib",
     register_type(_type_handle, "AlphaTestAttrib",
                   RenderAttrib::get_class_type());
                   RenderAttrib::get_class_type());
-    _attrib_slot = register_slot(_type_handle, 100, new AlphaTestAttrib);
+    _attrib_slot = register_slot(_type_handle, 20, new AlphaTestAttrib);
   }
   }
   virtual TypeHandle get_type() const {
   virtual TypeHandle get_type() const {
     return get_class_type();
     return get_class_type();

+ 1 - 1
panda/src/pgraph/lightAttrib.h

@@ -167,7 +167,7 @@ public:
     RenderAttrib::init_type();
     RenderAttrib::init_type();
     register_type(_type_handle, "LightAttrib",
     register_type(_type_handle, "LightAttrib",
                   RenderAttrib::get_class_type());
                   RenderAttrib::get_class_type());
-    _attrib_slot = register_slot(_type_handle, 20, new LightAttrib);
+    _attrib_slot = register_slot(_type_handle, 40, new LightAttrib);
   }
   }
   virtual TypeHandle get_type() const {
   virtual TypeHandle get_type() const {
     return get_class_type();
     return get_class_type();

+ 1 - 1
panda/src/pgraph/textureAttrib.h

@@ -191,7 +191,7 @@ public:
     RenderAttrib::init_type();
     RenderAttrib::init_type();
     register_type(_type_handle, "TextureAttrib",
     register_type(_type_handle, "TextureAttrib",
                   RenderAttrib::get_class_type());
                   RenderAttrib::get_class_type());
-    _attrib_slot = register_slot(_type_handle, 30, new TextureAttrib);
+    _attrib_slot = register_slot(_type_handle, 50, new TextureAttrib);
   }
   }
   virtual TypeHandle get_type() const {
   virtual TypeHandle get_type() const {
     return get_class_type();
     return get_class_type();

+ 1 - 1
panda/src/pgraph/transparencyAttrib.h

@@ -88,7 +88,7 @@ public:
     RenderAttrib::init_type();
     RenderAttrib::init_type();
     register_type(_type_handle, "TransparencyAttrib",
     register_type(_type_handle, "TransparencyAttrib",
                   RenderAttrib::get_class_type());
                   RenderAttrib::get_class_type());
-    _attrib_slot = register_slot(_type_handle, 100, new TransparencyAttrib);
+    _attrib_slot = register_slot(_type_handle, 30, new TransparencyAttrib);
   }
   }
   virtual TypeHandle get_type() const {
   virtual TypeHandle get_type() const {
     return get_class_type();
     return get_class_type();