|
@@ -20,12 +20,14 @@
|
|
// IN THE SOFTWARE.
|
|
// IN THE SOFTWARE.
|
|
//-----------------------------------------------------------------------------
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
+$PostFX::@@::modColor = "1 1 1 1";
|
|
|
|
+
|
|
singleton ShaderData( @@_Shader )
|
|
singleton ShaderData( @@_Shader )
|
|
{
|
|
{
|
|
DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl";
|
|
DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl";
|
|
- DXPixelShaderFile = $Core:modulePath @ "@@P.hlsl";
|
|
|
|
|
|
+ DXPixelShaderFile = "./@@P.hlsl";
|
|
OGLVertexShaderFile = $Core::CommonShaderPath @ "/postFX/gl/postFxV.glsl";
|
|
OGLVertexShaderFile = $Core::CommonShaderPath @ "/postFX/gl/postFxV.glsl";
|
|
- OGLPixelShaderFile = $Core:modulePath @ "@@P.glsl";
|
|
|
|
|
|
+ OGLPixelShaderFile = "./@@P.glsl";
|
|
|
|
|
|
samplerNames[0] = "$inputTex";
|
|
samplerNames[0] = "$inputTex";
|
|
|
|
|
|
@@ -55,6 +57,7 @@ singleton GFXStateBlockData( @@_StateBlock )
|
|
|
|
|
|
function @@::setShaderConsts( %this )
|
|
function @@::setShaderConsts( %this )
|
|
{
|
|
{
|
|
|
|
+ %this.setShaderConst( "$modColor", $PostFX::@@::modColor );
|
|
}
|
|
}
|
|
|
|
|
|
function @@::preProcess( %this )
|
|
function @@::preProcess( %this )
|
|
@@ -74,6 +77,7 @@ function @@::onEnabled( %this )
|
|
|
|
|
|
function @@::onDisabled( %this )
|
|
function @@::onDisabled( %this )
|
|
{
|
|
{
|
|
|
|
+ return true;
|
|
}
|
|
}
|
|
|
|
|
|
//This is used to populate the PostFXEditor's settings so the post FX can be edited
|
|
//This is used to populate the PostFXEditor's settings so the post FX can be edited
|
|
@@ -82,19 +86,27 @@ function @@::onDisabled( %this )
|
|
function @@::populatePostFXSettings(%this)
|
|
function @@::populatePostFXSettings(%this)
|
|
{
|
|
{
|
|
PostEffectEditorInspector.startGroup("@@ - General");
|
|
PostEffectEditorInspector.startGroup("@@ - General");
|
|
- PostEffectEditorInspector.addField("$PostFXManager::Settings::Enabled@@", "Enabled", "bool", "", $PostFXManager::PostFX::Enable@@, "");
|
|
|
|
|
|
+ PostEffectEditorInspector.addCallbackField("$PostFX::@@::Enabled", "Enabled", "bool", "", $PostFX::@@::Enabled, "", "toggle@@");
|
|
|
|
+ PostEffectEditorInspector.addField("$PostFX::@@::modColor", "Modifier Color", "colorI", "", $PostFX::@@::modColor, "");
|
|
PostEffectEditorInspector.endGroup();
|
|
PostEffectEditorInspector.endGroup();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+//This is called back from our callbackField defined in populatePostFXSettings to
|
|
|
|
+//Allow us to easily toggle the postFX and have it respond immediately
|
|
|
|
+function PostEffectEditorInspector::toggle@@(%this)
|
|
|
|
+{
|
|
|
|
+ if($PostFX::@@::Enabled)
|
|
|
|
+ @@.enable();
|
|
|
|
+ else
|
|
|
|
+ @@.disable();
|
|
|
|
+}
|
|
|
|
+
|
|
//This function pair(applyFromPreset and settingsApply) are done the way they are, with the separated variables
|
|
//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
|
|
//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
|
|
//when rendering. This allows us to modify things but still leave room for reverting or temporarily applying them
|
|
function @@::applyFromPreset(%this)
|
|
function @@::applyFromPreset(%this)
|
|
{
|
|
{
|
|
- //@@ Settings
|
|
|
|
- $PostFXManager::PostFX::Enable@@ = $PostFXManager::Settings::Enabled@@;
|
|
|
|
-
|
|
|
|
- if($PostFXManager::PostFX::Enable@@)
|
|
|
|
|
|
+ if($PostFX::@@::Enabled)
|
|
%this.enable();
|
|
%this.enable();
|
|
else
|
|
else
|
|
%this.disable();
|
|
%this.disable();
|
|
@@ -102,7 +114,6 @@ function @@::applyFromPreset(%this)
|
|
|
|
|
|
function @@::settingsApply(%this)
|
|
function @@::settingsApply(%this)
|
|
{
|
|
{
|
|
- $PostFXManager::Settings::Enabled@@ = $PostFXManager::PostFX::Enable@@;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
//Our actual postFX
|
|
//Our actual postFX
|
|
@@ -126,7 +137,7 @@ singleton PostEffect( @@ )
|
|
shader = @@_Shader;
|
|
shader = @@_Shader;
|
|
stateBlock = @@_StateBlock;
|
|
stateBlock = @@_StateBlock;
|
|
texture[0] = "$backBuffer";
|
|
texture[0] = "$backBuffer";
|
|
- target = "$outTex";
|
|
|
|
|
|
+ target = "$backBuffer";
|
|
targetFormat = "GFXFormatR16G16B16A16F";
|
|
targetFormat = "GFXFormatR16G16B16A16F";
|
|
targetScale = "1 1";
|
|
targetScale = "1 1";
|
|
};
|
|
};
|