From ac4802af8d431af0813f5def9dbb5190d8649639 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Mon, 2 Oct 2017 20:23:16 -0500 Subject: [PATCH] OpenGL2: Fix brightness when r_autoExposure is disabled The game world is too dark when r_autoExposure is disabled. It can be fixed by setting (cheat) r_cameraExposure to 1 but then the game is too bright when r_autoExposure is enabled. So default r_cameraExposure to 1 and make auto exposure subtract 1 from r_cameraExposure value. --- code/renderergl2/tr_init.c | 2 +- code/renderergl2/tr_postprocess.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/renderergl2/tr_init.c b/code/renderergl2/tr_init.c index ea315e66..2a91d538 100644 --- a/code/renderergl2/tr_init.c +++ b/code/renderergl2/tr_init.c @@ -1218,7 +1218,7 @@ void R_Register( void ) r_forceAutoExposureMin = ri.Cvar_Get( "r_forceAutoExposureMin", "-2.0", CVAR_CHEAT ); r_forceAutoExposureMax = ri.Cvar_Get( "r_forceAutoExposureMax", "2.0", CVAR_CHEAT ); - r_cameraExposure = ri.Cvar_Get( "r_cameraExposure", "0", CVAR_CHEAT ); + r_cameraExposure = ri.Cvar_Get( "r_cameraExposure", "1", CVAR_CHEAT ); r_depthPrepass = ri.Cvar_Get( "r_depthPrepass", "1", CVAR_ARCHIVE ); r_ssao = ri.Cvar_Get( "r_ssao", "0", CVAR_LATCH | CVAR_ARCHIVE ); diff --git a/code/renderergl2/tr_postprocess.c b/code/renderergl2/tr_postprocess.c index ade9ebf3..9931757b 100644 --- a/code/renderergl2/tr_postprocess.c +++ b/code/renderergl2/tr_postprocess.c @@ -82,7 +82,7 @@ void RB_ToneMap(FBO_t *hdrFbo, ivec4_t hdrBox, FBO_t *ldrFbo, ivec4_t ldrBox, in // tonemap color[0] = color[1] = - color[2] = pow(2, r_cameraExposure->value); //exp2(r_cameraExposure->value); + color[2] = pow(2, r_cameraExposure->value - autoExposure); //exp2(r_cameraExposure->value); color[3] = 1.0f; if (autoExposure)