]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
sRGB fallback: properly convert r_hdr_scenebrightness
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 8 Nov 2011 11:29:06 +0000 (11:29 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 8 Nov 2011 11:29:06 +0000 (11:29 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11535 d7cf8633-e32d-0410-b094-e92efae38249

gl_rmain.c

index cdcadf37da309130d04feddef29399592c584909..8e9817ef1e9ff8c521537df4b4fb100ba5fe2bfc 100644 (file)
@@ -6867,6 +6867,11 @@ void R_RenderView(void)
 
        r_refdef.view.colorscale = r_hdr_scenebrightness.value * r_hdr_irisadaptation_value.value;
 
+       if(vid_sRGB.integer && vid_sRGB_fallback.integer && !vid.sRGB3D)
+               // in sRGB fallback, behave similar to true sRGB: convert this
+               // value from linear to sRGB
+               r_refdef.view.colorscale = Image_sRGBFloatFromLinearFloat(r_refdef.view.colorscale);
+
        R_RenderView_UpdateViewVectors();
 
        R_Shadow_UpdateWorldLightSelection();