Browse Source

fix decaling assertion

cxgeorge 24 years ago
parent
commit
ee685be538
1 changed files with 6 additions and 2 deletions
  1. 6 2
      panda/src/dxgsg/dxGraphicsStateGuardian.cxx

+ 6 - 2
panda/src/dxgsg/dxGraphicsStateGuardian.cxx

@@ -4882,13 +4882,17 @@ begin_decal(GeomNode *base_geom) {
     nassertv(base_geom != (GeomNode *)NULL);
 
     _decal_level++;
-    nassertv(4*_decal_level < 16);
 
 #ifndef DISABLE_POLYGON_OFFSET_DECALING
     if (dx_decal_type == GDT_offset) {
-
 #define POLYGON_OFFSET_MULTIPLIER 2
 
+        // note: zbias seems inconsitently supported.  may be possible to fake it by
+        //       adding (delta * element[4,3]) to element [3,3] of a regular matrix
+        //       need to test this and see if to offers perf improvement over blend-based decaling
+
+        nassertv(POLYGON_OFFSET_MULTIPLIER*_decal_level < 16);  // 16 is the max allowed zbias
+
         // Just draw the base geometry normally.
         base_geom->draw(this);
         _d3dDevice->SetRenderState(D3DRENDERSTATE_ZBIAS, POLYGON_OFFSET_MULTIPLIER * _decal_level); // _decal_level better not be higher than 8!