From 5e45006b39ed0b99c1e0b0df438708297b9d46ee Mon Sep 17 00:00:00 2001 From: divverent Date: Thu, 27 Aug 2009 12:09:07 +0000 Subject: [PATCH] turn off saturation and motion/damage blur if a stereo rendering mode is active (as they do not work there) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9148 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_screen.c | 7 ++++++- cl_screen.h | 2 ++ gl_rmain.c | 8 ++++---- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/cl_screen.c b/cl_screen.c index 240941d9..631ace7f 100644 --- a/cl_screen.c +++ b/cl_screen.c @@ -1947,6 +1947,11 @@ void SCR_UpdateLoadingScreen (qboolean clear) key_consoleactive = old_key_consoleactive; } +qboolean R_Stereo_Active(void) +{ + return (vid.stereobuffer || r_stereo_redblue.integer || r_stereo_redgreen.integer || r_stereo_redcyan.integer || r_stereo_sidebyside.integer); +} + extern cvar_t cl_minfps; extern cvar_t cl_minfps_fade; extern cvar_t cl_minfps_qualitymax; @@ -2063,7 +2068,7 @@ void CL_UpdateScreen(void) else qglDisable(GL_POLYGON_STIPPLE); - if (vid.stereobuffer || r_stereo_redblue.integer || r_stereo_redgreen.integer || r_stereo_redcyan.integer || r_stereo_sidebyside.integer) + if (R_Stereo_Active()) { matrix4x4_t originalmatrix = r_refdef.view.matrix; matrix4x4_t offsetmatrix; diff --git a/cl_screen.h b/cl_screen.h index b5f62e72..df92c5a5 100644 --- a/cl_screen.h +++ b/cl_screen.h @@ -19,5 +19,7 @@ void CL_Screen_Init(void); void CL_Screen_Shutdown(void); void CL_UpdateScreen(void); +qboolean R_Stereo_Active(void); + #endif diff --git a/gl_rmain.c b/gl_rmain.c index b8a20587..e9521547 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -3348,7 +3348,7 @@ void R_Bloom_StartFrame(void) for (bloomtextureheight = 1;bloomtextureheight < r_bloomstate.bloomheight;bloomtextureheight *= 2); } - if ((r_hdr.integer || r_bloom.integer || r_motionblur.value > 0 || r_damageblur.value > 0) && ((r_bloom_resolution.integer < 4 || r_bloom_blur.value < 1 || r_bloom_blur.value >= 512) || r_refdef.view.width > gl_max_texture_size || r_refdef.view.height > gl_max_texture_size)) + if ((r_hdr.integer || r_bloom.integer || (!R_Stereo_Active() && (r_motionblur.value > 0 || r_damageblur.value > 0))) && ((r_bloom_resolution.integer < 4 || r_bloom_blur.value < 1 || r_bloom_blur.value >= 512) || r_refdef.view.width > gl_max_texture_size || r_refdef.view.height > gl_max_texture_size)) { Cvar_SetValueQuick(&r_hdr, 0); Cvar_SetValueQuick(&r_bloom, 0); @@ -3356,7 +3356,7 @@ void R_Bloom_StartFrame(void) Cvar_SetValueQuick(&r_damageblur, 0); } - if (!(r_glsl.integer && (r_glsl_postprocess.integer || r_glsl_saturation.value != 1 || (v_glslgamma.integer && !vid_gammatables_trivial))) && !r_bloom.integer && !r_hdr.integer && r_motionblur.value <= 0 && r_damageblur.value <= 0) + if (!(r_glsl.integer && (r_glsl_postprocess.integer || (!R_Stereo_Active() && r_glsl_saturation.value != 1) || (v_glslgamma.integer && !vid_gammatables_trivial))) && !r_bloom.integer && !r_hdr.integer && (R_Stereo_Active() || (r_motionblur.value <= 0 && r_damageblur.value <= 0))) screentexturewidth = screentextureheight = 0; if (!r_hdr.integer && !r_bloom.integer) bloomtexturewidth = bloomtextureheight = 0; @@ -3621,7 +3621,7 @@ static void R_BlendView(void) R_Mesh_TexBind(0, R_GetTexture(r_bloomstate.texture_screen)); GL_ActiveTexture(0);CHECKGLERROR - if(r_motionblur.value > 0 || r_damageblur.value > 0) + if(!R_Stereo_Active() && (r_motionblur.value > 0 || r_damageblur.value > 0)) { // declare alpha variable float a; @@ -3679,7 +3679,7 @@ static void R_BlendView(void) | (r_refdef.viewblend[3] > 0 ? SHADERPERMUTATION_VERTEXTEXTUREBLEND : 0) | ((v_glslgamma.value && !vid_gammatables_trivial) ? SHADERPERMUTATION_GAMMARAMPS : 0) | (r_glsl_postprocess.integer ? SHADERPERMUTATION_POSTPROCESSING : 0) - | (r_glsl_saturation.value != 1 ? SHADERPERMUTATION_SATURATION : 0); + | ((!R_Stereo_Active() && r_glsl_saturation.value != 1) ? SHADERPERMUTATION_SATURATION : 0); if (r_bloomstate.texture_bloom && !r_bloomstate.hdr) { -- 2.39.2