From 5cffa8873aec25ab2afa52b4b0910a68311b6e4e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 19 May 2018 19:19:48 +0200 Subject: [PATCH] - added a CVAR to disable per-plane rendering. This will require some comparisons on older hardware. On my Geforce 1060 rendering the full plane with one draw call is clearly faster in all cases I tested. --- src/gl/scene/gl_flats.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gl/scene/gl_flats.cpp b/src/gl/scene/gl_flats.cpp index d4105c569..39ab921b4 100644 --- a/src/gl/scene/gl_flats.cpp +++ b/src/gl/scene/gl_flats.cpp @@ -48,6 +48,8 @@ #include "gl/scene/gl_scenedrawer.h" #include "gl/renderer/gl_quaddrawer.h" +CVAR(Bool, gl_render_subsectors, false, 0) + //========================================================================== // // Flats @@ -165,7 +167,7 @@ void FDrawInfo::ProcessLights(GLFlat *flat, bool istrans) { flat->dynlightindex = GLRenderer->mLights->GetIndexPtr(); - if (flat->sector->ibocount > 0) + if (flat->sector->ibocount > 0 && !gl_render_subsectors) { SetupSectorLights(flat, GLPASS_LIGHTSONLY, nullptr); } @@ -212,7 +214,7 @@ void FDrawInfo::DrawSubsectors(GLFlat *flat, int pass, bool processlights, bool if (gl.legacyMode) processlights = false; auto vcount = flat->sector->ibocount; - if (vcount > 0) + if (vcount > 0 && !gl_render_subsectors) { if (processlights) SetupSectorLights(flat, GLPASS_ALL, &dli); drawcalls.Clock();