diff --git a/src/engine/renderer/tr_bsp.cpp b/src/engine/renderer/tr_bsp.cpp index b327378ded..45ed91ed58 100644 --- a/src/engine/renderer/tr_bsp.cpp +++ b/src/engine/renderer/tr_bsp.cpp @@ -2980,10 +2980,6 @@ static void R_LoadNodesAndLeafs( lump_t *nodeLump, lump_t *leafLump ) s_worldData.numnodes = numNodes + numLeafs; s_worldData.numDecisionNodes = numNodes; - // ydnar: skybox optimization - s_worldData.numSkyNodes = 0; - s_worldData.skyNodes = (bspNode_t**) ri.Hunk_Alloc( WORLD_MAX_SKY_NODES * sizeof( *s_worldData.skyNodes ), ha_pref::h_low ); - // load nodes for ( i = 0; i < numNodes; i++, in++, out++ ) { diff --git a/src/engine/renderer/tr_local.h b/src/engine/renderer/tr_local.h index 283b80d06e..4107c049c1 100644 --- a/src/engine/renderer/tr_local.h +++ b/src/engine/renderer/tr_local.h @@ -1890,9 +1890,6 @@ enum class ssaoMode { vec3_t maxs; }; -// ydnar: optimization -#define WORLD_MAX_SKY_NODES 32 - struct world_t { char name[ MAX_QPATH ]; // ie: maps/tim_dm2.bsp @@ -1913,9 +1910,6 @@ enum class ssaoMode { int numDecisionNodes; bspNode_t *nodes; - int numSkyNodes; - bspNode_t **skyNodes; // ydnar: don't walk the entire bsp when rendering sky - int numPortals; AABB *portals; diff --git a/src/engine/renderer/tr_scene.cpp b/src/engine/renderer/tr_scene.cpp index 4626d9dae0..97bde5c87a 100644 --- a/src/engine/renderer/tr_scene.cpp +++ b/src/engine/renderer/tr_scene.cpp @@ -541,7 +541,7 @@ void RE_RenderScene( const refdef_t *fd ) // will force a reset of the visible leafs even if the view hasn't moved tr.refdef.areamaskModified = false; - if ( !( tr.refdef.rdflags & RDF_NOWORLDMODEL ) && !( ( tr.refdef.rdflags & RDF_SKYBOXPORTAL ) && tr.world->numSkyNodes > 0 ) ) + if ( !( tr.refdef.rdflags & RDF_NOWORLDMODEL ) ) { int areaDiff; int i; diff --git a/src/engine/renderer/tr_world.cpp b/src/engine/renderer/tr_world.cpp index 43b746845d..335e67f99e 100644 --- a/src/engine/renderer/tr_world.cpp +++ b/src/engine/renderer/tr_world.cpp @@ -794,20 +794,6 @@ static void R_MarkLeaves() continue; } - // ydnar: don't want to walk the entire bsp to add skybox surfaces - if ( tr.refdef.rdflags & RDF_SKYBOXPORTAL ) - { - // this only happens once, as game/cgame know the origin of the skybox - // this also means the skybox portal cannot move, as this list is calculated once and never again - if ( tr.world->numSkyNodes < WORLD_MAX_SKY_NODES ) - { - tr.world->skyNodes[ tr.world->numSkyNodes++ ] = leaf; - } - - R_AddLeafSurfaces( leaf, FRUSTUM_CLIPALL ); - continue; - } - parent = leaf; do @@ -846,28 +832,14 @@ void R_AddWorldSurfaces() // clear out the visible min/max ClearBounds( tr.viewParms.visBounds[ 0 ], tr.viewParms.visBounds[ 1 ] ); - // render sky or world? - if ( tr.refdef.rdflags & RDF_SKYBOXPORTAL && tr.world->numSkyNodes > 0 ) - { - int i; - bspNode_t **node; + // determine which leaves are in the PVS / areamask + R_MarkLeaves(); - for ( i = 0, node = tr.world->skyNodes; i < tr.world->numSkyNodes; i++, node++ ) - { - R_AddLeafSurfaces( *node, FRUSTUM_CLIPALL ); - } - } - else - { - // determine which leaves are in the PVS / areamask - R_MarkLeaves(); - - // clear traversal list - backEndData[ tr.smpFrame ]->traversalLength = 0; + // clear traversal list + backEndData[ tr.smpFrame ]->traversalLength = 0; - // update visbounds and add surfaces that weren't cached with VBOs - R_RecursiveWorldNode( tr.world->nodes, FRUSTUM_CLIPALL ); - } + // update visbounds and add surfaces that weren't cached with VBOs + R_RecursiveWorldNode( tr.world->nodes, FRUSTUM_CLIPALL ); } /*