From 125b7aa636d25debb0044af414345b20fb719bc9 Mon Sep 17 00:00:00 2001 From: Azaezel Date: Mon, 5 Sep 2016 22:16:49 -0500 Subject: [PATCH] banding: conforms misbehaving postfx to the hdr buffer format until we have a proper srgb compatible buffer to minimize that with --- Engine/source/gfx/gfxDevice.cpp | 2 +- Templates/Full/game/core/scripts/client/postFx/GammaPostFX.cs | 1 + Templates/Full/game/core/scripts/client/postFx/fog.cs | 1 + Templates/Full/game/core/scripts/client/postFx/hdr.cs | 2 +- Templates/Full/game/core/scripts/client/renderManager.cs | 2 +- 5 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Engine/source/gfx/gfxDevice.cpp b/Engine/source/gfx/gfxDevice.cpp index fe446ce88..0bd703465 100644 --- a/Engine/source/gfx/gfxDevice.cpp +++ b/Engine/source/gfx/gfxDevice.cpp @@ -1320,7 +1320,7 @@ DefineEngineFunction( getBestHDRFormat, GFXFormat, (),, // Figure out the best HDR format. This is the smallest // format which supports blending and filtering. Vector formats; - formats.push_back( GFXFormatR10G10B10A2 ); + //formats.push_back( GFXFormatR10G10B10A2 ); TODO: replace with SRGB format once DX9 is gone - BJR formats.push_back( GFXFormatR16G16B16A16F ); formats.push_back( GFXFormatR16G16B16A16 ); GFXFormat format = GFX->selectSupportedFormat( &GFXDefaultRenderTargetProfile, diff --git a/Templates/Full/game/core/scripts/client/postFx/GammaPostFX.cs b/Templates/Full/game/core/scripts/client/postFx/GammaPostFX.cs index b88f31305..a61a3af9d 100644 --- a/Templates/Full/game/core/scripts/client/postFx/GammaPostFX.cs +++ b/Templates/Full/game/core/scripts/client/postFx/GammaPostFX.cs @@ -55,6 +55,7 @@ singleton PostEffect( GammaPostFX ) texture[0] = "$backBuffer"; texture[1] = $HDRPostFX::colorCorrectionRamp; + targetFormat = getBestHDRFormat(); }; function GammaPostFX::preProcess( %this ) diff --git a/Templates/Full/game/core/scripts/client/postFx/fog.cs b/Templates/Full/game/core/scripts/client/postFx/fog.cs index 78b2a8924..ea59a3f4c 100644 --- a/Templates/Full/game/core/scripts/client/postFx/fog.cs +++ b/Templates/Full/game/core/scripts/client/postFx/fog.cs @@ -62,6 +62,7 @@ singleton PostEffect( FogPostFx ) renderPriority = 5; + targetFormat = getBestHDRFormat(); isEnabled = true; }; diff --git a/Templates/Full/game/core/scripts/client/postFx/hdr.cs b/Templates/Full/game/core/scripts/client/postFx/hdr.cs index 6c8e870d0..90a66f5b3 100644 --- a/Templates/Full/game/core/scripts/client/postFx/hdr.cs +++ b/Templates/Full/game/core/scripts/client/postFx/hdr.cs @@ -318,7 +318,7 @@ function HDRPostFX::onDisabled( %this ) GammaPostFX.enable(); // Restore the non-HDR offscreen surface format. - %format = "GFXFormatR8G8B8A8"; + %format = getBestHDRFormat(); AL_FormatToken.format = %format; setReflectFormat( %format ); diff --git a/Templates/Full/game/core/scripts/client/renderManager.cs b/Templates/Full/game/core/scripts/client/renderManager.cs index a14287db1..ea7f84d03 100644 --- a/Templates/Full/game/core/scripts/client/renderManager.cs +++ b/Templates/Full/game/core/scripts/client/renderManager.cs @@ -33,7 +33,7 @@ function initRenderManager() { enabled = "false"; - format = "GFXFormatR16G16B16A16F"; + format = getBestHDRFormat(); depthFormat = "GFXFormatD24S8"; aaLevel = 0; // -1 = match backbuffer