diff --git a/panda/src/pgraph/config_pgraph.cxx b/panda/src/pgraph/config_pgraph.cxx index 1e668301b0..fb28e23549 100644 --- a/panda/src/pgraph/config_pgraph.cxx +++ b/panda/src/pgraph/config_pgraph.cxx @@ -193,6 +193,12 @@ ConfigVariableBool retransform_sprites "re-transformed back into the original object space, which is " "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 ("max-collect-vertices", 65535, PRC_DESC("Specifies the maximum number of vertices that are allowed to be " diff --git a/panda/src/pgraph/config_pgraph.h b/panda/src/pgraph/config_pgraph.h index 8b986fae72..7bf75978d3 100644 --- a/panda/src/pgraph/config_pgraph.h +++ b/panda/src/pgraph/config_pgraph.h @@ -46,6 +46,7 @@ extern ConfigVariableBool auto_break_cycles; extern ConfigVariableBool transform_cache; extern ConfigVariableBool state_cache; extern ConfigVariableBool retransform_sprites; +extern ConfigVariableBool support_fade_lod; extern ConfigVariableInt max_collect_vertices; extern ConfigVariableInt max_collect_indices; diff --git a/panda/src/pgraph/fadeLodNode.cxx b/panda/src/pgraph/fadeLodNode.cxx index 11d0e7fdc2..e253332b32 100755 --- a/panda/src/pgraph/fadeLodNode.cxx +++ b/panda/src/pgraph/fadeLodNode.cxx @@ -81,6 +81,10 @@ make_copy() const { //////////////////////////////////////////////////////////////////// bool FadeLODNode:: cull_callback(CullTraverser *trav, CullTraverserData &data) { + if (!support_fade_lod) { + return LODNode::cull_callback(trav, data); + } + if (is_any_shown()) { return show_switches_cull_callback(trav, data); }