From f72d98a1eb0b3928f464cb59a794108b090c5177 Mon Sep 17 00:00:00 2001 From: Robert Beckebans Date: Sun, 11 May 2014 11:49:14 +0200 Subject: [PATCH] Disabled shadow mapping for Mesa drivers fixes #103 --- neo/renderer/RenderSystem.cpp | 14 ++++++++++++++ neo/renderer/RenderSystem_init.cpp | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/neo/renderer/RenderSystem.cpp b/neo/renderer/RenderSystem.cpp index 2c16f557..3016f525 100644 --- a/neo/renderer/RenderSystem.cpp +++ b/neo/renderer/RenderSystem.cpp @@ -304,6 +304,20 @@ static void R_CheckCvars() glDisable( GL_MULTISAMPLE_ARB ); } } + + // RB: turn off shadow mapping for OpenGL drivers that are too slow + switch( glConfig.driverType ) + { + case GLDRV_OPENGL_ES2: + case GLDRV_OPENGL_ES3: + case GLDRV_OPENGL_MESA: + r_useShadowMapping.SetBool( false ); + break; + + default: + break; + } + // RB end } /* diff --git a/neo/renderer/RenderSystem_init.cpp b/neo/renderer/RenderSystem_init.cpp index 5c1c6348..3983c569 100644 --- a/neo/renderer/RenderSystem_init.cpp +++ b/neo/renderer/RenderSystem_init.cpp @@ -212,7 +212,7 @@ idCVar stereoRender_deGhost( "stereoRender_deGhost", "0.05", CVAR_FLOAT | CVAR_A idCVar r_useVirtualScreenResolution( "r_useVirtualScreenResolution", "1", CVAR_RENDERER | CVAR_BOOL | CVAR_ARCHIVE, "do 2D rendering at 640x480 and stretch to the current resolution" ); // RB: shadow mapping parameters -idCVar r_useShadowMapping( "r_useShadowMapping", "1", CVAR_RENDERER | CVAR_BOOL, "use shadow mapping instead of stencil shadows" ); +idCVar r_useShadowMapping( "r_useShadowMapping", "1", CVAR_RENDERER | CVAR_ARCHIVE | CVAR_BOOL, "use shadow mapping instead of stencil shadows" ); idCVar r_shadowMapFrustumFOV( "r_shadowMapFrustumFOV", "92", CVAR_RENDERER | CVAR_FLOAT, "oversize FOV for point light side matching" ); idCVar r_shadowMapSingleSide( "r_shadowMapSingleSide", "-1", CVAR_RENDERER | CVAR_INTEGER, "only draw a single side (0-5) of point lights" ); idCVar r_shadowMapImageSize( "r_shadowMapImageSize", "1024", CVAR_RENDERER | CVAR_INTEGER, "", 128, 2048 ); @@ -328,7 +328,7 @@ static void R_CheckPortableExtensions() } // RB: Mesa support - if( idStr::Icmpn( glConfig.renderer_string, "Mesa", 4 ) == 0 || idStr::Icmpn( glConfig.renderer_string, "X.org", 4 ) == 0 ) + //if( idStr::Icmpn( glConfig.renderer_string, "Mesa", 4 ) == 0 || idStr::Icmpn( glConfig.renderer_string, "X.org", 4 ) == 0 ) { glConfig.driverType = GLDRV_OPENGL_MESA; }