@@ -3305,8 +3305,8 @@ static void AdaptiveLightingReduction() {
33053305
33063306 gl_luminanceReductionShader->BindProgram ( 0 );
33073307
3308- const int width = tr. currentRenderImage [backEnd. currentMainFBO ]-> width ;
3309- const int height = tr. currentRenderImage [backEnd. currentMainFBO ]-> height ;
3308+ const int width = glConfig. vidWidth ;
3309+ const int height = glConfig. vidHeight ;
33103310
33113311 uint32_t globalWorkgroupX = ( width + 7 ) / 8 ;
33123312 uint32_t globalWorkgroupY = ( height + 7 ) / 8 ;
@@ -3316,6 +3316,7 @@ static void AdaptiveLightingReduction() {
33163316 gl_luminanceReductionShader->SetUniform_ViewWidth ( width );
33173317 gl_luminanceReductionShader->SetUniform_ViewHeight ( height );
33183318 vec4_t parms { log2f ( r_toneMappingHDRMax.Get () ) };
3319+ parms[1 ] = UINT32_MAX / ( width * height * ( parms[0 ] + 8 .0f ) );
33193320 gl_luminanceReductionShader->SetUniform_TonemapParms2 ( parms );
33203321
33213322 glMemoryBarrier ( GL_ATOMIC_COUNTER_BARRIER_BIT );
@@ -3395,6 +3396,10 @@ void RB_CameraPostFX()
33953396 r_toneMappingDarkAreaPointHDR.Get (), r_toneMappingDarkAreaPointLDR.Get (), tonemapParms[2 ], tonemapParms[3 ] );
33963397 gl_cameraEffectsShader->SetUniform_TonemapParms ( tonemapParms );
33973398
3399+ vec4_t parms{ log2f ( r_toneMappingHDRMax.Get () ) };
3400+ parms[1 ] = UINT32_MAX / ( glConfig.vidWidth * glConfig.vidHeight * ( parms[0 ] + 8 .0f ) );
3401+ gl_cameraEffectsShader->SetUniform_TonemapParms2 ( parms );
3402+
33983403 gl_cameraEffectsShader->SetUniform_TonemapAdaptiveExposure (
33993404 glConfig2.adaptiveExposureAvailable && r_toneMappingAdaptiveExposure.Get () );
34003405 gl_cameraEffectsShader->SetUniform_TonemapExposure ( r_toneMappingExposure.Get () );
0 commit comments