Browse Source

add support-fade-lod

David Rose 19 years ago
parent
commit
755288c2d5

+ 6 - 0
panda/src/pgraph/config_pgraph.cxx

@@ -193,6 +193,12 @@ ConfigVariableBool retransform_sprites
           "re-transformed back into the original object space, which is "
           "re-transformed back into the original object space, which is "
           "necessary in order for fog to work correctly on the sprites."));
           "necessary in order for fog to work correctly on the sprites."));
 
 
+ConfigVariableBool support_fade_lod
+("support-fade-lod", true,
+ PRC_DESC("Set this false to make FadeLOD nodes behave like regular LOD nodes "
+          "(ignoring the fade time).  This may be useful, for instance, to "
+          "test the performance impact of using FadeLOD nodes."));
+
 ConfigVariableInt max_collect_vertices
 ConfigVariableInt max_collect_vertices
 ("max-collect-vertices", 65535,
 ("max-collect-vertices", 65535,
  PRC_DESC("Specifies the maximum number of vertices that are allowed to be "
  PRC_DESC("Specifies the maximum number of vertices that are allowed to be "

+ 1 - 0
panda/src/pgraph/config_pgraph.h

@@ -46,6 +46,7 @@ extern ConfigVariableBool auto_break_cycles;
 extern ConfigVariableBool transform_cache;
 extern ConfigVariableBool transform_cache;
 extern ConfigVariableBool state_cache;
 extern ConfigVariableBool state_cache;
 extern ConfigVariableBool retransform_sprites;
 extern ConfigVariableBool retransform_sprites;
+extern ConfigVariableBool support_fade_lod;
 extern ConfigVariableInt max_collect_vertices;
 extern ConfigVariableInt max_collect_vertices;
 extern ConfigVariableInt max_collect_indices;
 extern ConfigVariableInt max_collect_indices;
 
 

+ 4 - 0
panda/src/pgraph/fadeLodNode.cxx

@@ -81,6 +81,10 @@ make_copy() const {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 bool FadeLODNode::
 bool FadeLODNode::
 cull_callback(CullTraverser *trav, CullTraverserData &data) {
 cull_callback(CullTraverser *trav, CullTraverserData &data) {
+  if (!support_fade_lod) {
+    return LODNode::cull_callback(trav, data);
+  }
+
   if (is_any_shown()) {
   if (is_any_shown()) {
     return show_switches_cull_callback(trav, data);
     return show_switches_cull_callback(trav, data);
   }
   }