|
@@ -22,63 +22,63 @@
|
|
|
|
|
|
|
|
|
/// Blends between the scene and the tone mapped scene.
|
|
|
-$HDRPostFX::enableToneMapping = 0.5;
|
|
|
+$PostFX::HDRPostFX::enableToneMapping = 0.5;
|
|
|
|
|
|
/// The tone mapping middle grey or exposure value used
|
|
|
/// to adjust the overall "balance" of the image.
|
|
|
///
|
|
|
/// 0.18 is fairly common value.
|
|
|
///
|
|
|
-$HDRPostFX::keyValue = 0.18;
|
|
|
+$PostFX::HDRPostFX::keyValue = 0.18;
|
|
|
|
|
|
/// The minimum luninace value to allow when tone mapping
|
|
|
/// the scene. Is particularly useful if your scene very
|
|
|
/// dark or has a black ambient color in places.
|
|
|
-$HDRPostFX::minLuminace = 0.001;
|
|
|
+$PostFX::HDRPostFX::minLuminace = 0.001;
|
|
|
|
|
|
/// The lowest luminance value which is mapped to white. This
|
|
|
/// is usually set to the highest visible luminance in your
|
|
|
/// scene. By setting this to smaller values you get a contrast
|
|
|
/// enhancement.
|
|
|
-$HDRPostFX::whiteCutoff = 1.0;
|
|
|
+$PostFX::HDRPostFX::whiteCutoff = 1.0;
|
|
|
|
|
|
/// The rate of adaptation from the previous and new
|
|
|
/// average scene luminance.
|
|
|
-$HDRPostFX::adaptRate = 2.0;
|
|
|
+$PostFX::HDRPostFX::adaptRate = 2.0;
|
|
|
|
|
|
/// Blends between the scene and the blue shifted version
|
|
|
/// of the scene for a cinematic desaturated night effect.
|
|
|
-$HDRPostFX::enableBlueShift = 0.0;
|
|
|
+$PostFX::HDRPostFX::enableBlueShift = 0.0;
|
|
|
|
|
|
/// The blue shift color value.
|
|
|
-$HDRPostFX::blueShiftColor = "1.05 0.97 1.27";
|
|
|
+$PostFX::HDRPostFX::blueShiftColor = "1.05 0.97 1.27";
|
|
|
|
|
|
|
|
|
/// Blends between the scene and the bloomed scene.
|
|
|
-$HDRPostFX::enableBloom = 1.0;
|
|
|
+$PostFX::HDRPostFX::enableBloom = 1.0;
|
|
|
|
|
|
/// The threshold luminace value for pixels which are
|
|
|
/// considered "bright" and need to be bloomed.
|
|
|
-$HDRPostFX::brightPassThreshold = 1.0;
|
|
|
+$PostFX::HDRPostFX::brightPassThreshold = 1.0;
|
|
|
|
|
|
/// These are used in the gaussian blur of the
|
|
|
/// bright pass for the bloom effect.
|
|
|
-$HDRPostFX::gaussMultiplier = 0.3;
|
|
|
-$HDRPostFX::gaussMean = 0.0;
|
|
|
-$HDRPostFX::gaussStdDev = 0.8;
|
|
|
+$PostFX::HDRPostFX::gaussMultiplier = 0.3;
|
|
|
+$PostFX::HDRPostFX::gaussMean = 0.0;
|
|
|
+$PostFX::HDRPostFX::gaussStdDev = 0.8;
|
|
|
|
|
|
-/// The 1x255 color correction ramp texture used
|
|
|
-/// by both the HDR shader and the GammaPostFx shader
|
|
|
-/// for doing full screen color correction.
|
|
|
-$HDRPostFX::colorCorrectionRamp = "core/postFX/images/null_color_ramp.png";
|
|
|
+// The tonemapping algo to use
|
|
|
+$PostFX::HDRPostFX::tonemapMode = "Filmic";
|
|
|
+
|
|
|
+$PostFX::HDRPostFX::enableAutoExposure = true;
|
|
|
|
|
|
|
|
|
singleton ShaderData( HDR_BrightPassShader )
|
|
|
{
|
|
|
DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl";
|
|
|
- DXPixelShaderFile = $Core::CommonShaderPath @ "/postFX/hdr/brightPassFilterP.hlsl";
|
|
|
+ DXPixelShaderFile = "./brightPassFilterP.hlsl";
|
|
|
OGLVertexShaderFile = $Core::CommonShaderPath @ "/postFX/gl/postFxV.glsl";
|
|
|
- OGLPixelShaderFile = $Core::CommonShaderPath @ "/postFX/hdr/gl/brightPassFilterP.glsl";
|
|
|
+ OGLPixelShaderFile = "./brightPassFilterP.glsl";
|
|
|
|
|
|
samplerNames[0] = "$inputTex";
|
|
|
samplerNames[1] = "$luminanceTex";
|
|
@@ -88,10 +88,10 @@ singleton ShaderData( HDR_BrightPassShader )
|
|
|
|
|
|
singleton ShaderData( HDR_DownScale4x4Shader )
|
|
|
{
|
|
|
- DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/hdr/downScale4x4V.hlsl";
|
|
|
- DXPixelShaderFile = $Core::CommonShaderPath @ "/postFX/hdr/downScale4x4P.hlsl";
|
|
|
- OGLVertexShaderFile = $Core::CommonShaderPath @ "/postFX/hdr/gl/downScale4x4V.glsl";
|
|
|
- OGLPixelShaderFile = $Core::CommonShaderPath @ "/postFX/hdr/gl/downScale4x4P.glsl";
|
|
|
+ DXVertexShaderFile = "./downScale4x4V.hlsl";
|
|
|
+ DXPixelShaderFile = "./downScale4x4P.hlsl";
|
|
|
+ OGLVertexShaderFile = "./downScale4x4V.glsl";
|
|
|
+ OGLPixelShaderFile = "./downScale4x4P.glsl";
|
|
|
|
|
|
samplerNames[0] = "$inputTex";
|
|
|
|
|
@@ -101,9 +101,9 @@ singleton ShaderData( HDR_DownScale4x4Shader )
|
|
|
singleton ShaderData( HDR_BloomGaussBlurHShader )
|
|
|
{
|
|
|
DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl";
|
|
|
- DXPixelShaderFile = $Core::CommonShaderPath @ "/postFX/hdr/bloomGaussBlurHP.hlsl";
|
|
|
+ DXPixelShaderFile = "./bloomGaussBlurHP.hlsl";
|
|
|
OGLVertexShaderFile = $Core::CommonShaderPath @ "/postFX/gl/postFxV.glsl";
|
|
|
- OGLPixelShaderFile = $Core::CommonShaderPath @ "/postFX/hdr/gl/bloomGaussBlurHP.glsl";
|
|
|
+ OGLPixelShaderFile = "./bloomGaussBlurHP.glsl";
|
|
|
|
|
|
samplerNames[0] = "$inputTex";
|
|
|
|
|
@@ -113,9 +113,9 @@ singleton ShaderData( HDR_BloomGaussBlurHShader )
|
|
|
singleton ShaderData( HDR_BloomGaussBlurVShader )
|
|
|
{
|
|
|
DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl";
|
|
|
- DXPixelShaderFile = $Core::CommonShaderPath @ "/postFX/hdr/bloomGaussBlurVP.hlsl";
|
|
|
+ DXPixelShaderFile = "./bloomGaussBlurVP.hlsl";
|
|
|
OGLVertexShaderFile = $Core::CommonShaderPath @ "/postFX/gl/postFxV.glsl";
|
|
|
- OGLPixelShaderFile = $Core::CommonShaderPath @ "/postFX/hdr/gl/bloomGaussBlurVP.glsl";
|
|
|
+ OGLPixelShaderFile = "./bloomGaussBlurVP.glsl";
|
|
|
|
|
|
samplerNames[0] = "$inputTex";
|
|
|
|
|
@@ -125,9 +125,9 @@ singleton ShaderData( HDR_BloomGaussBlurVShader )
|
|
|
singleton ShaderData( HDR_SampleLumShader )
|
|
|
{
|
|
|
DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl";
|
|
|
- DXPixelShaderFile = $Core::CommonShaderPath @ "/postFX/hdr/sampleLumInitialP.hlsl";
|
|
|
+ DXPixelShaderFile = "./sampleLumInitialP.hlsl";
|
|
|
OGLVertexShaderFile = $Core::CommonShaderPath @ "/postFX/gl/postFxV.glsl";
|
|
|
- OGLPixelShaderFile = $Core::CommonShaderPath @ "/postFX/hdr/gl/sampleLumInitialP.glsl";
|
|
|
+ OGLPixelShaderFile = "./sampleLumInitialP.glsl";
|
|
|
|
|
|
samplerNames[0] = "$inputTex";
|
|
|
|
|
@@ -137,9 +137,9 @@ singleton ShaderData( HDR_SampleLumShader )
|
|
|
singleton ShaderData( HDR_DownSampleLumShader )
|
|
|
{
|
|
|
DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl";
|
|
|
- DXPixelShaderFile = $Core::CommonShaderPath @ "/postFX/hdr/sampleLumIterativeP.hlsl";
|
|
|
+ DXPixelShaderFile = "./sampleLumIterativeP.hlsl";
|
|
|
OGLVertexShaderFile = $Core::CommonShaderPath @ "/postFX/gl/postFxV.glsl";
|
|
|
- OGLPixelShaderFile = $Core::CommonShaderPath @ "/postFX/hdr/gl/sampleLumIterativeP.glsl";
|
|
|
+ OGLPixelShaderFile = "./sampleLumIterativeP.glsl";
|
|
|
|
|
|
samplerNames[0] = "$inputTex";
|
|
|
|
|
@@ -149,9 +149,9 @@ singleton ShaderData( HDR_DownSampleLumShader )
|
|
|
singleton ShaderData( HDR_CalcAdaptedLumShader )
|
|
|
{
|
|
|
DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl";
|
|
|
- DXPixelShaderFile = $Core::CommonShaderPath @ "/postFX/hdr/calculateAdaptedLumP.hlsl";
|
|
|
+ DXPixelShaderFile = "./calculateAdaptedLumP.hlsl";
|
|
|
OGLVertexShaderFile = $Core::CommonShaderPath @ "/postFX/gl/postFxV.glsl";
|
|
|
- OGLPixelShaderFile = $Core::CommonShaderPath @ "/postFX/hdr/gl/calculateAdaptedLumP.glsl";
|
|
|
+ OGLPixelShaderFile = "./calculateAdaptedLumP.glsl";
|
|
|
|
|
|
samplerNames[0] = "$currLum";
|
|
|
samplerNames[1] = "$lastAdaptedLum";
|
|
@@ -162,9 +162,9 @@ singleton ShaderData( HDR_CalcAdaptedLumShader )
|
|
|
singleton ShaderData( HDR_CombineShader )
|
|
|
{
|
|
|
DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl";
|
|
|
- DXPixelShaderFile = $Core::CommonShaderPath @ "/postFX/hdr/finalPassCombineP.hlsl";
|
|
|
+ DXPixelShaderFile = "./finalPassCombineP.hlsl";
|
|
|
OGLVertexShaderFile = $Core::CommonShaderPath @ "/postFX/gl/postFxV.glsl";
|
|
|
- OGLPixelShaderFile = $Core::CommonShaderPath @ "/postFX/hdr/gl/finalPassCombineP.glsl";
|
|
|
+ OGLPixelShaderFile = "./finalPassCombineP.glsl";
|
|
|
|
|
|
samplerNames[0] = "$sceneTex";
|
|
|
samplerNames[1] = "$luminanceTex";
|
|
@@ -221,20 +221,20 @@ singleton GFXStateBlockData( HDRStateBlock )
|
|
|
|
|
|
function HDRPostFX::setShaderConsts( %this )
|
|
|
{
|
|
|
- %this.setShaderConst( "$brightPassThreshold", $HDRPostFX::brightPassThreshold );
|
|
|
- %this.setShaderConst( "$g_fMiddleGray", $HDRPostFX::keyValue );
|
|
|
+ %this.setShaderConst( "$brightPassThreshold", $PostFX::HDRPostFX::brightPassThreshold );
|
|
|
+ %this.setShaderConst( "$g_fMiddleGray", $PostFX::HDRPostFX::keyValue );
|
|
|
|
|
|
%bloomH = %this-->bloomH;
|
|
|
- %bloomH.setShaderConst( "$gaussMultiplier", $HDRPostFX::gaussMultiplier );
|
|
|
- %bloomH.setShaderConst( "$gaussMean", $HDRPostFX::gaussMean );
|
|
|
- %bloomH.setShaderConst( "$gaussStdDev", $HDRPostFX::gaussStdDev );
|
|
|
+ %bloomH.setShaderConst( "$gaussMultiplier", $PostFX::HDRPostFX::gaussMultiplier );
|
|
|
+ %bloomH.setShaderConst( "$gaussMean", $PostFX::HDRPostFX::gaussMean );
|
|
|
+ %bloomH.setShaderConst( "$gaussStdDev", $PostFX::HDRPostFX::gaussStdDev );
|
|
|
|
|
|
%bloomV = %this-->bloomV;
|
|
|
- %bloomV.setShaderConst( "$gaussMultiplier", $HDRPostFX::gaussMultiplier );
|
|
|
- %bloomV.setShaderConst( "$gaussMean", $HDRPostFX::gaussMean );
|
|
|
- %bloomV.setShaderConst( "$gaussStdDev", $HDRPostFX::gaussStdDev );
|
|
|
+ %bloomV.setShaderConst( "$gaussMultiplier", $PostFX::HDRPostFX::gaussMultiplier );
|
|
|
+ %bloomV.setShaderConst( "$gaussMean", $PostFX::HDRPostFX::gaussMean );
|
|
|
+ %bloomV.setShaderConst( "$gaussStdDev", $PostFX::HDRPostFX::gaussStdDev );
|
|
|
|
|
|
- %minLuminace = $HDRPostFX::minLuminace;
|
|
|
+ %minLuminace = $PostFX::HDRPostFX::minLuminace;
|
|
|
if ( %minLuminace <= 0.0 )
|
|
|
{
|
|
|
// The min should never be pure zero else the
|
|
@@ -243,22 +243,32 @@ function HDRPostFX::setShaderConsts( %this )
|
|
|
}
|
|
|
%this-->adaptLum.setShaderConst( "$g_fMinLuminace", %minLuminace );
|
|
|
|
|
|
- %this-->finalLum.setShaderConst( "$adaptRate", $HDRPostFX::adaptRate );
|
|
|
+ %this-->finalLum.setShaderConst( "$adaptRate", $PostFX::HDRPostFX::adaptRate );
|
|
|
|
|
|
%combinePass = %this-->combinePass;
|
|
|
- %combinePass.setShaderConst( "$g_fEnableToneMapping", $HDRPostFX::enableToneMapping );
|
|
|
- %combinePass.setShaderConst( "$g_fMiddleGray", $HDRPostFX::keyValue );
|
|
|
- %combinePass.setShaderConst( "$g_fBloomScale", $HDRPostFX::enableBloom );
|
|
|
- %combinePass.setShaderConst( "$g_fEnableBlueShift", $HDRPostFX::enableBlueShift );
|
|
|
- %combinePass.setShaderConst( "$g_fBlueShiftColor", $HDRPostFX::blueShiftColor );
|
|
|
+ %combinePass.setShaderConst( "$g_fEnableToneMapping", $PostFX::HDRPostFX::enableToneMapping );
|
|
|
+ %combinePass.setShaderConst( "$g_fMiddleGray", $PostFX::HDRPostFX::keyValue );
|
|
|
+ %combinePass.setShaderConst( "$g_fBloomScale", $PostFX::HDRPostFX::enableBloom );
|
|
|
+ %combinePass.setShaderConst( "$g_fEnableBlueShift", $PostFX::HDRPostFX::enableBlueShift );
|
|
|
+ %combinePass.setShaderConst( "$g_fBlueShiftColor", $PostFX::HDRPostFX::blueShiftColor );
|
|
|
+
|
|
|
+ %combinePass.setShaderConst( "$g_fEnableAutoExposure", $PostFX::HDRPostFX::enableAutoExposure );
|
|
|
+
|
|
|
+ %tonemapMode = 1;
|
|
|
+ if($PostFX::HDRPostFX::tonemapMode $= "Filmic")
|
|
|
+ %tonemapMode = 1;
|
|
|
+ else if($PostFX::HDRPostFX::tonemapMode $= "ACES")
|
|
|
+ %tonemapMode = 2;
|
|
|
+
|
|
|
+ %combinePass.setShaderConst( "$g_fTonemapMode", %tonemapMode );
|
|
|
|
|
|
%clampedGamma = mClamp( $pref::Video::Gamma, 2.0, 2.5);
|
|
|
%combinePass.setShaderConst( "$g_fOneOverGamma", 1 / %clampedGamma );
|
|
|
%combinePass.setShaderConst( "$Brightness", $pref::Video::Brightness );
|
|
|
%combinePass.setShaderConst( "$Contrast", $pref::Video::Contrast );
|
|
|
|
|
|
- %whiteCutoff = ( $HDRPostFX::whiteCutoff * $HDRPostFX::whiteCutoff ) *
|
|
|
- ( $HDRPostFX::whiteCutoff * $HDRPostFX::whiteCutoff );
|
|
|
+ %whiteCutoff = ( $PostFX::HDRPostFX::whiteCutoff * $PostFX::HDRPostFX::whiteCutoff ) *
|
|
|
+ ( $PostFX::HDRPostFX::whiteCutoff * $PostFX::HDRPostFX::whiteCutoff );
|
|
|
%combinePass.setShaderConst( "$g_fWhiteCutoff", %whiteCutoff );
|
|
|
}
|
|
|
|
|
@@ -266,8 +276,8 @@ function HDRPostFX::preProcess( %this )
|
|
|
{
|
|
|
%combinePass = %this-->combinePass;
|
|
|
|
|
|
- if ( %combinePass.texture[3] !$= $HDRPostFX::colorCorrectionRamp )
|
|
|
- %combinePass.setTexture( 3, $HDRPostFX::colorCorrectionRamp );
|
|
|
+ if ( %combinePass.texture[3] !$= $PostFX::HDRPostFX::colorCorrectionRamp )
|
|
|
+ %combinePass.setTexture( 3, $PostFX::HDRPostFX::colorCorrectionRamp );
|
|
|
}
|
|
|
|
|
|
function HDRPostFX::onEnabled( %this )
|
|
@@ -301,12 +311,16 @@ function HDRPostFX::onEnabled( %this )
|
|
|
// hdr encoding takes effect in all the shaders and
|
|
|
// that the offscreen surface is enabled.
|
|
|
resetLightManager();
|
|
|
+
|
|
|
+ $PostFX::HDRPostFX::Enabled = true;
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
function HDRPostFX::onDisabled( %this )
|
|
|
{
|
|
|
+ $PostFX::HDRPostFX::Enabled = false;
|
|
|
+
|
|
|
// Enable a special GammaCorrection PostFX when this is disabled.
|
|
|
GammaPostFX.enable();
|
|
|
|
|
@@ -330,7 +344,7 @@ function HDRPostFX::onAdd( %this )
|
|
|
//HDR should really be on at all times
|
|
|
//%this.enable();
|
|
|
|
|
|
- $HDRPostFX::enableToneMapping = 1;
|
|
|
+ $PostFX::HDRPostFX::enableToneMapping = 1;
|
|
|
}
|
|
|
|
|
|
//This is used to populate the PostFXEditor's settings so the post FX can be edited
|
|
@@ -339,62 +353,64 @@ function HDRPostFX::onAdd( %this )
|
|
|
function HDRPostFX::populatePostFXSettings(%this)
|
|
|
{
|
|
|
PostEffectEditorInspector.startGroup("HDR - General");
|
|
|
- PostEffectEditorInspector.addField("$PostFXManager::Settings::HDR::keyValue", "Key Value", "range", "", $HDRPostFX::keyValue, "0 1 10");
|
|
|
- PostEffectEditorInspector.addField("$PostFXManager::Settings::HDR::minLuminace", "Minimum Luminance", "range", "", $HDRPostFX::minLuminace, "0 1 10");
|
|
|
- PostEffectEditorInspector.addField("$PostFXManager::Settings::HDR::whiteCutoff", "White Cutoff", "range", "", $HDRPostFX::whiteCutoff, "0 1 10");
|
|
|
- PostEffectEditorInspector.addField("$PostFXManager::Settings::HDR::adaptRate", "Brightness Adapt Rate", "range", "", $HDRPostFX::adaptRate, "0 1 10");
|
|
|
+ PostEffectEditorInspector.addCallbackField("$PostFX::HDRPostFX::Enabled", "Enabled", "bool", "", $PostFX::HDRPostFX::Enabled, "", "toggleHDRPostFX");
|
|
|
+ PostEffectEditorInspector.addField("$PostFX::HDRPostFX::minLuminace", "Minimum Luminance", "range", "", $PostFX::HDRPostFX::minLuminace, "0 1 100");
|
|
|
+ PostEffectEditorInspector.addField("$PostFX::HDRPostFX::whiteCutoff", "White Cutoff", "range", "", $PostFX::HDRPostFX::whiteCutoff, "0 10 20");
|
|
|
+ PostEffectEditorInspector.addField("$PostFX::HDRPostFX::adaptRate", "Brightness Adapt Rate", "range", "", $PostFX::HDRPostFX::adaptRate, "0 1 10");
|
|
|
+ PostEffectEditorInspector.endGroup();
|
|
|
+
|
|
|
+ PostEffectEditorInspector.startGroup("HDR - Tonemapping");
|
|
|
+ PostEffectEditorInspector.addField("$PostFX::HDRPostFX::tonemapMode", "Tonemapping Mode", "list", "", $PostFX::HDRPostFX::tonemapMode, "Filmic,ACES");
|
|
|
PostEffectEditorInspector.endGroup();
|
|
|
|
|
|
PostEffectEditorInspector.startGroup("HDR - Bloom");
|
|
|
- PostEffectEditorInspector.addField("$PostFXManager::Settings::HDR::enableBloom", "Enable Bloom", "bool", "", $HDRPostFX::enableBloom, "");
|
|
|
- PostEffectEditorInspector.addField("$PostFXManager::Settings::HDR::brightPassThreshold", "Bright Pass Threshold", "float", "", $HDRPostFX::brightPassThreshold, "");
|
|
|
- PostEffectEditorInspector.addField("$PostFXManager::Settings::HDR::gaussMultiplier", "Blur Multiplier", "float", "", $HDRPostFX::gaussMultiplier, "");
|
|
|
- PostEffectEditorInspector.addField("$PostFXManager::Settings::HDR::gaussMean", "Blur \"Mean\" Value", "float", "", $HDRPostFX::gaussMean, "");
|
|
|
- PostEffectEditorInspector.addField("$PostFXManager::Settings::HDR::gaussStdDev", "Blur \"Std. Dev\" Value", "float", "", $HDRPostFX::gaussStdDev, "");
|
|
|
+ PostEffectEditorInspector.addField("$PostFX::HDRPostFX::enableBloom", "Enable Bloom", "bool", "", $PostFX::HDRPostFX::enableBloom, "");
|
|
|
+ PostEffectEditorInspector.addField("$PostFX::HDRPostFX::brightPassThreshold", "Bright Pass Threshold", "float", "", $PostFX::HDRPostFX::brightPassThreshold, "");
|
|
|
+ PostEffectEditorInspector.addField("$PostFX::HDRPostFX::gaussMultiplier", "Blur Multiplier", "range", "", $PostFX::HDRPostFX::gaussMultiplier, "0 1 10");
|
|
|
+ PostEffectEditorInspector.addField("$PostFX::HDRPostFX::gaussMean", "Blur Mean Value", "range", "", $PostFX::HDRPostFX::gaussMean, "0 1 10");
|
|
|
+ PostEffectEditorInspector.addField("$PostFX::HDRPostFX::gaussStdDev", "Blur Std. Dev Value", "range", "", $PostFX::HDRPostFX::gaussStdDev, "0 1 10");
|
|
|
PostEffectEditorInspector.endGroup();
|
|
|
|
|
|
- PostEffectEditorInspector.startGroup("HDR - Effects");
|
|
|
- PostEffectEditorInspector.addField("$PostFXManager::Settings::HDR::enableBlueShift", "Enable Blue Shift", "bool", "", $HDRPostFX::enableBlueShift, "");
|
|
|
- PostEffectEditorInspector.addField("$PostFXManager::Settings::HDR::blueShiftColor", "Blue Shift Color", "colorF", "", $HDRPostFX::blueShiftColor, "");
|
|
|
+ PostEffectEditorInspector.startGroup("HDR - Adaptation");
|
|
|
+ PostEffectEditorInspector.addField("$PostFX::HDRPostFX::enableAutoExposure", "Enable Auto Exposure", "bool", "", $PostFX::HDRPostFX::enableAutoExposure, "");
|
|
|
+ PostEffectEditorInspector.addField("$PostFX::HDRPostFX::keyValue", "Key Value", "range", "", $PostFX::HDRPostFX::keyValue, "0 1 10");
|
|
|
+ PostEffectEditorInspector.addField("$PostFX::HDRPostFX::enableBlueShift", "Enable Blue Shift", "bool", "", $PostFX::HDRPostFX::enableBlueShift, "");
|
|
|
+ PostEffectEditorInspector.addField("$PostFX::HDRPostFX::blueShiftColor", "Blue Shift Color", "colorF", "", $PostFX::HDRPostFX::blueShiftColor, "");
|
|
|
PostEffectEditorInspector.endGroup();
|
|
|
}
|
|
|
|
|
|
-//This function pair(applyFromPreset and settingsApply) are done the way they are, with the separated variables
|
|
|
-//so that we can effectively store the 'settings' away from the live variables that the postFX's actually utilize
|
|
|
-//when rendering. This allows us to modify things but still leave room for reverting or temporarily applying them
|
|
|
+function PostEffectEditorInspector::toggleHDRPostFX(%this)
|
|
|
+{
|
|
|
+ if($PostFX::HDRPostFX::Enabled)
|
|
|
+ HDRPostFX.enable();
|
|
|
+ else
|
|
|
+ HDRPostFX.disable();
|
|
|
+}
|
|
|
+
|
|
|
function HDRPostFX::applyFromPreset(%this)
|
|
|
{
|
|
|
- //HDRPostFX Settings
|
|
|
- $HDRPostFX::adaptRate = $PostFXManager::Settings::HDR::adaptRate;
|
|
|
- $HDRPostFX::blueShiftColor = $PostFXManager::Settings::HDR::blueShiftColor;
|
|
|
- $HDRPostFX::brightPassThreshold = $PostFXManager::Settings::HDR::brightPassThreshold;
|
|
|
- $HDRPostFX::enableBloom = $PostFXManager::Settings::HDR::enableBloom;
|
|
|
- $HDRPostFX::enableBlueShift = $PostFXManager::Settings::HDR::enableBlueShift;
|
|
|
- $HDRPostFX::enableToneMapping = $PostFXManager::Settings::HDR::enableToneMapping;
|
|
|
- $HDRPostFX::gaussMean = $PostFXManager::Settings::HDR::gaussMean;
|
|
|
- $HDRPostFX::gaussMultiplier = $PostFXManager::Settings::HDR::gaussMultiplier;
|
|
|
- $HDRPostFX::gaussStdDev = $PostFXManager::Settings::HDR::gaussStdDev;
|
|
|
- $HDRPostFX::keyValue = $PostFXManager::Settings::HDR::keyValue;
|
|
|
- $HDRPostFX::minLuminace = $PostFXManager::Settings::HDR::minLuminace;
|
|
|
- $HDRPostFX::whiteCutoff = $PostFXManager::Settings::HDR::whiteCutoff;
|
|
|
- $HDRPostFX::colorCorrectionRamp = $PostFXManager::Settings::ColorCorrectionRamp;
|
|
|
+ if($PostFX::HDRPostFX::Enabled)
|
|
|
+ HDRPostFX.enable();
|
|
|
+ else
|
|
|
+ HDRPostFX.disable();
|
|
|
}
|
|
|
|
|
|
-function HDRPostFX::settingsApply(%this)
|
|
|
+function HDRPostFX::savePresetSettings(%this)
|
|
|
{
|
|
|
- $PostFXManager::Settings::HDR::adaptRate = $HDRPostFX::adaptRate;
|
|
|
- $PostFXManager::Settings::HDR::blueShiftColor = $HDRPostFX::blueShiftColor;
|
|
|
- $PostFXManager::Settings::HDR::brightPassThreshold = $HDRPostFX::brightPassThreshold;
|
|
|
- $PostFXManager::Settings::HDR::enableBloom = $HDRPostFX::enableBloom;
|
|
|
- $PostFXManager::Settings::HDR::enableBlueShift = $HDRPostFX::enableBlueShift;
|
|
|
- $PostFXManager::Settings::HDR::enableToneMapping = $HDRPostFX::enableToneMapping;
|
|
|
- $PostFXManager::Settings::HDR::gaussMean = $HDRPostFX::gaussMean;
|
|
|
- $PostFXManager::Settings::HDR::gaussMultiplier = $HDRPostFX::gaussMultiplier;
|
|
|
- $PostFXManager::Settings::HDR::gaussStdDev = $HDRPostFX::gaussStdDev;
|
|
|
- $PostFXManager::Settings::HDR::keyValue = $HDRPostFX::keyValue;
|
|
|
- $PostFXManager::Settings::HDR::minLuminace = $HDRPostFX::minLuminace;
|
|
|
- $PostFXManager::Settings::HDR::whiteCutoff = $HDRPostFX::whiteCutoff;
|
|
|
- $PostFXManager::Settings::ColorCorrectionRamp = $HDRPostFX::colorCorrectionRamp;
|
|
|
+ PostFXManager::savePresetSetting("$PostFX::HDRPostFX::Enabled");
|
|
|
+ PostFXManager::savePresetSetting("$PostFX::HDRPostFX::minLuminace");
|
|
|
+ PostFXManager::savePresetSetting("$PostFX::HDRPostFX::whiteCutoff");
|
|
|
+ PostFXManager::savePresetSetting("$PostFX::HDRPostFX::adaptRate");
|
|
|
+ PostFXManager::savePresetSetting("$PostFX::HDRPostFX::tonemapMode");
|
|
|
+ PostFXManager::savePresetSetting("$PostFX::HDRPostFX::enableBloom");
|
|
|
+ PostFXManager::savePresetSetting("$PostFX::HDRPostFX::brightPassThreshold");
|
|
|
+ PostFXManager::savePresetSetting("$PostFX::HDRPostFX::gaussMultiplier");
|
|
|
+ PostFXManager::savePresetSetting("$PostFX::HDRPostFX::gaussMean");
|
|
|
+ PostFXManager::savePresetSetting("$PostFX::HDRPostFX::gaussStdDev");
|
|
|
+ PostFXManager::savePresetSetting("$PostFX::HDRPostFX::enableAutoExposure");
|
|
|
+ PostFXManager::savePresetSetting("$PostFX::HDRPostFX::keyValue");
|
|
|
+ PostFXManager::savePresetSetting("$PostFX::HDRPostFX::enableBlueShift");
|
|
|
+ PostFXManager::savePresetSetting("$PostFX::HDRPostFX::blueShiftColor");
|
|
|
}
|
|
|
|
|
|
singleton PostEffect( HDRPostFX )
|
|
@@ -537,7 +553,7 @@ singleton PostEffect( HDRPostFX )
|
|
|
texture[0] = "$backBuffer";
|
|
|
texture[1] = "#adaptedLum";
|
|
|
texture[2] = "#bloomFinal";
|
|
|
- texture[3] = $HDRPostFX::colorCorrectionRamp;
|
|
|
+ texture[3] = $PostFX::HDRPostFX::colorCorrectionRamp;
|
|
|
target = "$backBuffer";
|
|
|
};
|
|
|
};
|
|
@@ -562,7 +578,7 @@ singleton GFXStateBlockData( LuminanceVisStateBlock : PFX_DefaultStateBlock )
|
|
|
|
|
|
function LuminanceVisPostFX::setShaderConsts( %this )
|
|
|
{
|
|
|
- %this.setShaderConst( "$brightPassThreshold", $HDRPostFX::brightPassThreshold );
|
|
|
+ %this.setShaderConst( "$brightPassThreshold", $PostFX::HDRPostFX::brightPassThreshold );
|
|
|
}
|
|
|
|
|
|
singleton PostEffect( LuminanceVisPostFX )
|