Merge pull request #894 from Areloch/SMAA_and_Misc20220916

Implements SMAA and a few unaffiliated fixes
This commit is contained in:
Brian Roberts 2022-09-16 23:11:39 -05:00 committed by GitHub
commit 391b656e2c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
36 changed files with 3435 additions and 23 deletions

View file

@ -25,7 +25,10 @@
#include "core/strings/stringFunctions.h"
#include "core/util/hashFunction.h"
#include "console/consoleTypes.h"
#ifdef TORQUE_NET_CURL
#include "app/net/httpObject.h"
#endif
// jamesu - debug DNS
//#define TORQUE_DEBUG_LOOKUPS
@ -559,7 +562,9 @@ bool Net::init()
smConnectionReceive = new ConnectionReceiveEvent();
smPacketReceive = new PacketReceiveEvent();
#ifdef TORQUE_NET_CURL
HTTPObject::init();
#endif
Process::notify(&Net::process, PROCESS_NET_ORDER);
@ -570,7 +575,9 @@ void Net::shutdown()
{
Process::remove(&Net::process);
#ifdef TORQUE_NET_CURL
HTTPObject::shutdown();
#endif
while (gPolledSockets.size() > 0)
{
@ -1103,8 +1110,10 @@ void Net::process()
processListenSocket(PlatformNetState::udpSocket);
processListenSocket(PlatformNetState::udp6Socket);
#ifdef TORQUE_NET_CURL
// process HTTPObject
HTTPObject::process();
#endif
// process the polled sockets. This blob of code performs functions
// similar to WinsockProc in winNet.cc

View file

@ -110,6 +110,7 @@ function configureCanvas()
%resY = $pref::Video::Resolution.y;
%bpp = $pref::Video::BitDepth;
%rate = $pref::Video::RefreshRate;
%aaMode = $pref::video::AAMode;
%aa = $pref::Video::AA;
%fs = ($pref::Video::deviceMode == 2);
@ -118,7 +119,7 @@ function configureCanvas()
"--Screen Mode : " @ %fsLabel NL
"--Bits Per Pixel : " @ %bpp NL
"--Refresh Rate : " @ %rate NL
"--FXAA Level : " @ %aa NL
"--Anit-Aliasing Type : " @ %aaMode NL
"--------------");
// Actually set the new video mode
@ -140,10 +141,30 @@ function configureCanvas()
// AA piggybacks on the AA setting in $pref::Video::mode.
// We need to parse the setting between AA modes, and then it's level
// It's formatted as AATypexAALevel
// So, FXAAx4 or MLAAx2
if ( isObject( FXAAPostFX ) )
FXAAPostFX.Enabled = ( %aa > 0 ) ? true : false;
if(isObject( FXAAPostFX ))
{
if ( startsWith(%aaMode, "FXAA") )
{
FXAAPostFX.Enabled = true;
}
else
{
FXAAPostFX.Enabled = false;
}
}
if(isObject( SMAAPostFX ))
{
if ( startsWith(%aaMode, "SMAA") )
{
SMAAPostFX.Enabled = true;
}
else
{
SMAAPostFX.Enabled = false;
}
}
}
function GuiCanvas::modeStrToPrefs(%this, %modeStr)

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,6 @@
<PostEffectAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="SMAAPostFX"
scriptFile="@assetFile=SMAAPostFX.cs"
VersionId="1" />

View file

@ -0,0 +1,180 @@
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
// "Jorge Jimenez, Subpixel Morphological Antialiasing | SMAA"
// http://www.iryoku.com/smaa/
singleton GFXStateBlockData( SMAA_Edge_D_StateBlock : PFX_DefaultStateBlock )
{
stencilDefined = true;
stencilEnable = true;
stencilPassOp = GFXStencilOpReplace;
stencilFunc = GFXCmpAlways;
stencilRef = 1;
samplersDefined = true;
samplerStates[0] = SamplerClampLinear;
};
singleton ShaderData( SMAA_Edge_D_Shader )
{
DXVertexShaderFile = "./SMAA_Edge_V.hlsl";
DXPixelShaderFile = "./SMAA_Edge_P.hlsl";
OGLVertexShaderFile = "./gl/SMAA_Edge_V.glsl";
OGLPixelShaderFile = "./gl/SMAA_Edge_P.glsl";
samplerNames[0] = "$sceneTex";
samplerNames[1] = "$depthTex";
pixVersion = 3.0;
};
singleton GFXStateBlockData( SMAA_Blend_W_StateBlock : PFX_DefaultStateBlock )
{
stencilDefined = true;
stencilEnable = true;
stencilPassOp = GFXStencilOpKeep;
stencilFunc = GFXCmpEqual;
stencilRef = 1;
samplersDefined = true;
samplerStates[0] = SamplerClampLinear;
samplerStates[1] = SamplerClampLinear;
samplerStates[2] = SamplerClampLinear;
};
singleton ShaderData( SMAA_Blend_W_Shader )
{
DXVertexShaderFile = "./SMAA_BlendWeight_V.hlsl";
DXPixelShaderFile = "./SMAA_BlendWeight_P.hlsl";
OGLVertexShaderFile = "./gl/SMAA_BlendWeight_V.glsl";
OGLPixelShaderFile = "./gl/SMAA_BlendWeight_P.glsl";
samplerNames[0] = "$edgesTex";
samplerNames[1] = "$areaTex";
samplerNames[2] = "$searchTex";
pixVersion = 3.0;
};
singleton GFXStateBlockData( SMAA_Neighbor_H_StateBlock : PFX_DefaultStateBlock )
{
stencilEnable = false;
samplersDefined = true;
samplerStates[0] = SamplerClampLinear;
samplerStates[1] = SamplerClampLinear;
};
singleton ShaderData( SMAA_Neighbor_H_Shader )
{
DXVertexShaderFile = "./SMAA_Neighbor_H_Blending_V.hlsl";
DXPixelShaderFile = "./SMAA_Neighbor_H_Blending_P.hlsl";
OGLVertexShaderFile = "./gl/SMAA_Neighbor_H_Blending_V.glsl";
OGLPixelShaderFile = "./gl/SMAA_Neighbor_H_Blending_P.glsl";
samplerNames[0] = "$sceneTex";
samplerNames[1] = "$blendTex";
pixVersion = 3.0;
};
singleton PostEffect( SMAAPostFX )
{
enabled = false;
allowReflectPass = false;
renderTime = "PFXAfterDiffuse";
texture[0] = "$backBuffer";
texture[1] = "#deferred";
target = "#edgesPass";
targetClear = PFXTargetClear_OnDraw;
targetClearColor = "0 0 0 0";
shader = SMAA_Edge_D_Shader;
stateBlock = SMAA_Edge_D_StateBlock;
singleton PostEffect()
{
internalName = "Edge Pass";
texture[0] = "#edgesPass";
textureAsset[1] = "Core_PostFX:AreaTexDX9_image";
textureAsset[2] = "Core_PostFX:SearchTex_image";
target = "#blendPass";
targetClear = PFXTargetClear_OnDraw;
targetClearColor = "0 0 0 0";
shader = SMAA_Blend_W_Shader;
stateBlock = SMAA_Blend_W_StateBlock;
};
singleton PostEffect()
{
internalName = "BlendPass";
texture[0] = "$backBuffer";
texture[1] = "#blendPass";
target = "$backBuffer";
shader = SMAA_Neighbor_H_Shader;
stateBlock = SMAA_Neighbor_H_StateBlock;
};
};
function SMAAPostFX::preProcess( %this )
{
if ( $pref::video::AAMode !$= %this.quality )
{
%this.quality = $pref::video::AAMode;
if(%this.quality $= "")
%this.quality = "SMAA";
if(%this.quality $= "SMAA")
{
%this.setShaderMacro( "SMAA_PRESET_LOW", 0 );
%this.setShaderMacro( "SMAA_PRESET_MEDIUM", 0 );
%this.setShaderMacro( "SMAA_PRESET_HIGH", 1 );
%this.setShaderMacro( "SMAA_PRESET_ULTRA", 0 );
}
else if(%this.quality $= "SMAA High")
{
%this.setShaderMacro( "SMAA_PRESET_LOW", 0 );
%this.setShaderMacro( "SMAA_PRESET_MEDIUM", 0 );
%this.setShaderMacro( "SMAA_PRESET_HIGH", 0 );
%this.setShaderMacro( "SMAA_PRESET_ULTRA", 1 );
}
}
}

View file

@ -0,0 +1,47 @@
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
#include "core/rendering/shaders/shaderModel.hlsl"
#include "SMAA_Params.hlsl"
TORQUE_UNIFORM_SAMPLER2D(edgesTex, 0);
TORQUE_UNIFORM_SAMPLER2D(areaTex, 1);
TORQUE_UNIFORM_SAMPLER2D(searchTex, 2);
struct v_Blend
{
float4 hpos : TORQUE_POSITION;
float2 uv0 : TEXCOORD0;
float2 pixcoord : TEXCOORD1;
float4 offset[3] : TEXCOORD2;
};
float4 main( v_Blend IN ) : TORQUE_TARGET0
{
return SMAABlendingWeightCalculationPS(IN.uv0, IN.pixcoord, IN.offset, texture_edgesTex, texture_areaTex, texture_searchTex, float4(0,0,0,0));
}

View file

@ -0,0 +1,54 @@
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
#include "core/rendering/shaders/torque.hlsl"
#include "core/rendering/shaders/postFX/postFx.hlsl"
#include "SMAA_Params.hlsl"
uniform float4 rtParams0;
// (2)
struct v_Blend
{
float4 hpos : TORQUE_POSITION;
float2 uv0 : TEXCOORD0;
float2 pixcoord : TEXCOORD1;
float4 offset[3] : TEXCOORD2;
};
v_Blend main( PFXVert IN )
{
v_Blend OUT;
OUT.hpos = float4(IN.pos,1.0f);
OUT.uv0 = viewportCoordToRenderTarget( IN.uv, rtParams0 );
SMAABlendingWeightCalculationVS(OUT.uv0, OUT.pixcoord, OUT.offset);
return OUT;
}

View file

@ -0,0 +1,50 @@
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
#include "core/rendering/shaders/shaderModelAutoGen.hlsl"
#include "core/rendering/shaders/shaderModel.hlsl"
#include "SMAA_Params.hlsl"
TORQUE_UNIFORM_SAMPLER2D(sceneTex, 0);
TORQUE_UNIFORM_SAMPLER2D(depthTex, 1);
struct v_Edge
{
float4 hpos : TORQUE_POSITION;
float2 uv0 : TEXCOORD0;
float4 offset[3] : TEXCOORD1;
};
float4 main( v_Edge IN ) : TORQUE_TARGET0
{
#if SMAA_PREDICATION
float4 depth = TORQUE_DEFERRED_UNCONDITION( depthTex, IN.uv0 ).w;
return float4(SMAALumaEdgeDetectionPS(IN.uv0, IN.offset, texture_sceneTex, texture_depthTex),0,0);
#else
return float4(SMAALumaEdgeDetectionPS(IN.uv0, IN.offset, texture_sceneTex),0,0);
#endif
}

View file

@ -0,0 +1,52 @@
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
#include "core/rendering/shaders/torque.hlsl"
#include "core/rendering/shaders/postFX/postFx.hlsl"
#include "SMAA_Params.hlsl"
uniform float4 rtParams0;
// (1)
struct v_Edge
{
float4 hpos : TORQUE_POSITION;
float2 uv0 : TEXCOORD0;
float4 offset[3] : TEXCOORD1;
};
v_Edge main( PFXVert IN )
{
v_Edge OUT;
OUT.hpos = float4(IN.pos,1.0f);
OUT.uv0 = viewportCoordToRenderTarget( IN.uv, rtParams0 );
SMAAEdgeDetectionVS(OUT.uv0, OUT.offset);
return OUT;
}

View file

@ -0,0 +1,43 @@
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
#include "core/rendering/shaders/shaderModel.hlsl"
#include "SMAA_Params.hlsl"
TORQUE_UNIFORM_SAMPLER2D(sceneTex, 0);
TORQUE_UNIFORM_SAMPLER2D(blendTex, 1);
struct v_NHBlend
{
float4 hpos : TORQUE_POSITION;
float2 uv0 : TEXCOORD0;
float4 offset : TEXCOORD1;
};
float4 main( v_NHBlend IN ) : TORQUE_TARGET0
{
//return float4(TORQUE_TEX2D(blendTex, IN.uv0));
return SMAANeighborhoodBlendingPS(IN.uv0, IN.offset, texture_sceneTex, texture_blendTex);
}

View file

@ -0,0 +1,53 @@
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
#include "core/rendering/shaders/torque.hlsl"
#include "core/rendering/shaders/postFX/postFx.hlsl"
#include "SMAA_Params.hlsl"
uniform float4 rtParams0;
// (3)
struct v_NHBlend
{
float4 hpos : TORQUE_POSITION;
float2 uv0 : TEXCOORD0;
float4 offset : TEXCOORD1;
};
v_NHBlend main( PFXVert IN )
{
v_NHBlend OUT;
OUT.hpos = float4(IN.pos,1.0f);
OUT.uv0 = viewportCoordToRenderTarget( IN.uv, rtParams0 );
SMAANeighborhoodBlendingVS(OUT.uv0, OUT.offset);
return OUT;
}

View file

@ -0,0 +1,16 @@
uniform float2 oneOverTargetSize;
uniform float2 targetSize;
#define SMAA_RT_METRICS float4(oneOverTargetSize, targetSize)
//Used for defining SMAA params
#define SMAA_HLSL_4 1
#define SMAA_PREDICATION 0
#include "SMAA.h"

View file

@ -0,0 +1,3 @@
<ImageAsset
AssetName="AreaTexDX9_image"
imageFile="@assetFile=AreaTexDX9.dds"/>

View file

@ -0,0 +1,3 @@
<ImageAsset
AssetName="AreaTex_image"
imageFile="@assetFile=AreaTex.dds"/>

View file

@ -0,0 +1,3 @@
<ImageAsset
AssetName="SearchTex_image"
imageFile="@assetFile=SearchTex.dds"/>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,47 @@
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
#include "core/rendering/shaders/gl/hlslCompat.glsl"
#include "shadergen:/autogenConditioners.h"
#include "SMAA_Params.glsl"
#define SMAA_INCLUDE_VS 0
#define SMAA_INCLUDE_PS 1
#include "SMAA.glsl"
uniform sampler2D edgesTex;
uniform sampler2D areaTex;
uniform sampler2D searchTex;
in vec4 hpos;
in vec2 uv0;
in vec2 pix_uv;
in vec4 offset[3];
out vec4 OUT_col;
void main()
{
OUT_col = SMAABlendingWeightCalculationPS(uv0, pix_uv, offset, edgesTex, areaTex, searchTex, vec4(0,0,0,0));
}

View file

@ -0,0 +1,59 @@
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
#include "core/rendering/shaders/gl/hlslCompat.glsl"
#include "core/rendering/shaders/gl/torque.glsl"
in vec4 vPosition;
in vec2 vTexCoord0;
in vec2 vTexCoord1;
out vec4 hpos;
out vec2 uv0;
out vec2 pix_uv;
out vec4 offset[3];
uniform vec4 rtParams0;
#include "SMAA_Params.glsl"
#define SMAA_INCLUDE_VS 1
#define SMAA_INCLUDE_PS 0
#include "SMAA.glsl"
void main()
{
#ifndef T3D_FLIP
vTexCoord0 = vTexCoord0 * vec2(1.0, -1.0) + vec2(0.0, 1.0);
#endif // T3D_FLIP
gl_Position = vPosition;
hpos = gl_Position;
pix_uv = vTexCoord1;
uv0 = viewportCoordToRenderTarget( vTexCoord0, rtParams0 );
SMAABlendingWeightCalculationVS(uv0, pix_uv, offset);
correctSSP(gl_Position);
}

View file

@ -0,0 +1,52 @@
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
#include "core/rendering/shaders/gl/torque.glsl"
#include "core/rendering/shaders/gl/hlslCompat.glsl"
#include "shadergen:/autogenConditioners.h"
#include "SMAA_Params.glsl"
#define SMAA_INCLUDE_VS 0
#define SMAA_INCLUDE_PS 1
#include "SMAA.glsl"
uniform sampler2D sceneTex;
uniform sampler2D depthTex;
in vec4 hpos;
in vec2 uv0;
in vec4 offset[3];
out vec4 OUT_col;
void main()
{
#if SMAA_PREDICATION
OUT_col = vec4(SMAALumaEdgeDetectionPS(uv0, offset, sceneTex, depthTex),0,0);
#else
OUT_col = vec4(SMAALumaEdgeDetectionPS(uv0, offset, sceneTex),0,0);
#endif
}

View file

@ -0,0 +1,55 @@
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
#include "core/rendering/shaders/gl/hlslCompat.glsl"
#include "core/rendering/shaders/gl/torque.glsl"
in vec4 vPosition;
in vec2 vTexCoord0;
out vec4 hpos;
out vec2 uv0;
out vec4 offset[3];
uniform vec4 rtParams0;
#include "SMAA_Params.glsl"
#define SMAA_INCLUDE_VS 1
#define SMAA_INCLUDE_PS 0
#include "SMAA.glsl"
void main()
{
#ifndef T3D_FLIP
vTexCoord0 = vTexCoord0 * vec2(1.0, -1.0) + vec2(0.0, 1.0);
#endif // T3D_FLIP
gl_Position = vPosition;
hpos = gl_Position;
uv0 = viewportCoordToRenderTarget( vTexCoord0, rtParams0 );
SMAAEdgeDetectionVS(uv0, offset);
correctSSP(gl_Position);
}

View file

@ -0,0 +1,46 @@
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
#include "core/rendering/shaders/gl/hlslCompat.glsl"
#include "SMAA_Params.glsl"
#define SMAA_INCLUDE_VS 0
#define SMAA_INCLUDE_PS 1
#include "SMAA.glsl"
uniform sampler2D sceneTex;
uniform sampler2D blendTex;
in vec4 hpos;
in vec2 uv0;
in vec4 offset;
out vec4 OUT_col;
void main()
{
//OUT_col = vec4(texture(blendTex, uv0.xy));
OUT_col= SMAANeighborhoodBlendingPS(uv0, offset, sceneTex, blendTex);
}

View file

@ -0,0 +1,55 @@
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
#include "core/rendering/shaders/gl/hlslCompat.glsl"
#include "core/rendering/shaders/gl/torque.glsl"
in vec4 vPosition;
in vec2 vTexCoord0;
out vec4 hpos;
out vec2 uv0;
out vec4 offset;
uniform vec4 rtParams0;
#include "SMAA_Params.glsl"
#define SMAA_INCLUDE_VS 1
#define SMAA_INCLUDE_PS 0
#include "SMAA.glsl"
void main()
{
#ifndef T3D_FLIP
vTexCoord0 = vTexCoord0 * vec2(1.0, -1.0) + vec2(0.0, 1.0);
#endif // T3D_FLIP
gl_Position = vPosition;
hpos = gl_Position;
uv0 = viewportCoordToRenderTarget( vTexCoord0, rtParams0 );
SMAANeighborhoodBlendingVS(uv0, offset);
correctSSP(gl_Position);
}

View file

@ -0,0 +1,20 @@
uniform float2 oneOverTargetSize;
uniform float2 targetSize;
uniform float2 targetRatio;
#define SMAA_RT_METRICS float4(oneOverTargetSize, targetSize)
#define SMAA_GLSL_4 1
#define SMAA_PREDICATION 0
#define SMAA_FLIP_Y 0
#define T3D_FLIP 1

View file

@ -688,6 +688,7 @@ function AutodetectGraphics_Apply(%shaderVer, %intel, %videoMem )
$pref::PostFX::EnableLightRays = false;
$pref::PostFX::EnableVignette = false;
$pref::Video::AAMode = "None";
$pref::Video::AA = 0;
$pref::Video::defaultAnisotropy = 0;
}
@ -714,6 +715,7 @@ function AutodetectGraphics_Apply(%shaderVer, %intel, %videoMem )
$pref::PostFX::EnableLightRays = false;
$pref::PostFX::EnableVignette = false;
$pref::Video::AAMode = "None";
$pref::Video::AA = 0;
$pref::Video::defaultAnisotropy = 0;
}
@ -744,6 +746,7 @@ function AutodetectGraphics_Apply(%shaderVer, %intel, %videoMem )
$pref::PostFX::EnableLightRays = true;
$pref::PostFX::EnableVignette = true;
$pref::Video::AAMode = "SMAA High";
$pref::Video::AA = 4;
$pref::Video::defaultAnisotropy = 16;
}
@ -770,6 +773,7 @@ function AutodetectGraphics_Apply(%shaderVer, %intel, %videoMem )
$pref::PostFX::EnableLightRays = true;
$pref::PostFX::EnableVignette = true;
$pref::Video::AAMode = "SMAA";
$pref::Video::AA = 4;
$pref::Video::defaultAnisotropy = 4;
@ -799,6 +803,7 @@ function AutodetectGraphics_Apply(%shaderVer, %intel, %videoMem )
$pref::PostFX::EnableLightRays = false;
$pref::PostFX::EnableVignette = false;
$pref::Video::AAMode = "FXAA";
$pref::Video::AA = 0;
$pref::Video::defaultAnisotropy = 0;
}

View file

@ -7,4 +7,5 @@
DecalsFile="@assetFile=ExampleLevel.mis.decals"
ForestFile="@assetFile=ExampleLevel.forest"
NavmeshFile="@assetFile=ExampleLevel.nav"
staticObjectAssetDependency0="@asset=Prototyping:FloorGray"
VersionId="1"/>

View file

@ -12,7 +12,6 @@ new Scene(ExampleLevel) {
Enabled = "1";
};
new SkyBox(theSky) {
Material = "BlankSkyMat";
MaterialAsset = "Core_Rendering:BlankSkyMat";
drawBottom = "0";
dirtyGameObject = "0";
@ -22,6 +21,7 @@ new Scene(ExampleLevel) {
elevation = "45";
color = "0.968628 0.901961 0.901961 1";
ambient = "0.337255 0.533333 0.619608 1";
brightness = "2";
texSize = "2048";
overDarkFactor = "3000 1500 750 250";
shadowDistance = "200";

View file

@ -1,14 +1,23 @@
$PostFX::HDRPostFX::Enabled = 1;
$PostFX::HDRPostFX::exposureValue = 1.5;
$PostFX::HDRPostFX::whitePoint = 2.5;
$PostFX::HDRPostFX::logContrast = 1;
$PostFX::HDRPostFX::saturationValue = 1;
$PostFX::HDRPostFX::colorFilter = "1.0 1.0 1.0";
$PostFX::HDRPostFX::minLuminace = 0.001;
$PostFX::HDRPostFX::whiteCutoff = 1;
$PostFX::HDRPostFX::adaptRate = 2;
$PostFX::HDRPostFX::tonemapMode = "ACES";
$PostFX::HDRPostFX::enableBloom = 1;
$PostFX::HDRPostFX::brightPassThreshold = 1;
$PostFX::HDRPostFX::gaussMultiplier = 0.3;
$PostFX::HDRPostFX::gaussMean = 0;
$PostFX::HDRPostFX::gaussStdDev = 0.8;
$PostFX::HDRPostFX::enableAutoExposure = "0";
$PostFX::HDRPostFX::keyValue = 0.18;
$PostFX::HDRPostFX::enableBlueShift = 0;
$PostFX::HDRPostFX::blueShiftColor = "1.05 0.97 1.27";
$PostFX::HDRPostFX::enableBloom = 1;
$PostFX::HDRPostFX::threshold = 1.25;
$PostFX::HDRPostFX::intensity = 0.25;
$PostFX::HDRPostFX::radius = 4;
$PostFX::HDRPostFX::enableDirt = 1;
$PostFX::HDRPostFX::dirtScale = 2048;
$PostFX::HDRPostFX::dirtIntensity = 2;
$PostFX::HDRPostFX::dirtImage = "core/postFX/images/lensDirt.png";
$PostFX::HDRPostFX::dirtEdgeMinDist = 0.125;
$PostFX::HDRPostFX::dirtEdgeMaxDist = 0.75;
$PostFX::HDRPostFX::dirtEdgeMinVal = 0.05;

View file

@ -474,7 +474,7 @@ function populateGraphicsSettingsList()
%yesNoList = "No\tYes";
%onOffList = "Off\tOn";
%anisoFilter = "Off\t4\t8\t16";
%aaFilter = "Off\t1\t2\t4";
%aaTypeFilter = "None\tFXAA\tSMAA\tSMAA High";
OptionsMenuSettingsList.addOptionQualityLevelRow("Lighting Quality", "$pref::Graphics::LightingQuality",
LightingQualityList, false, "", true, "Amount and drawdistance of local lights");
OptionsMenuSettingsList.addOptionQualityLevelRow("Shadow Quality", "$pref::Graphics::ShadowQuality",
@ -502,7 +502,8 @@ function populateGraphicsSettingsList()
OptionsMenuSettingsList.addOptionQualityLevelRow("Shader Quality", "$pref::Graphics::ShaderQuality",
ShaderQualityGroup, false, "", true, "Dictates the overall shader quality level, adjusting what features are enabled.");
OptionsMenuSettingsList.addOptionRow("Anisotropic Filtering", "$pref::Video::defaultAnisotropy", %anisoFilter, false, "", true, "Amount of Anisotropic Filtering on textures, which dictates their sharpness at a distance");
OptionsMenuSettingsList.addOptionRow("Anti-Aliasing", "$pref::Video::AA", %aaFilter, false, "", true, "Amount of Post-Processing Anti-Aliasing applied to rendering");
OptionsMenuSettingsList.addOptionRow("Anti-Aliasing Type", "$pref::Video::AAMode", %aaTypeFilter, false, "", true, "The Anti-Aliasing Method applied to rendering");
OptionsMenuSettingsList.addOptionBoolRow("Parallax", "$pref::Video::enableParallaxMapping", %onOffList, false, "", true, "Whether the surface parallax shader effect is enabled", "");
OptionsMenuSettingsList.addOptionBoolRow("Water Reflections", "$pref::Water::enableTrueReflections", %onOffList, false, "", true, "Whether water reflections are enabled", "");
@ -588,10 +589,10 @@ function updateDisplaySettings()
%newFullScreen = %deviceModeName $= "Fullscreen" ? true : false;
%newRefresh = $pref::Video::RefreshRate;
%newVsync = $pref::Video::enableVerticalSync;
%newFSAA = $pref::Video::AA;
%newAA = $pref::Video::AA;
// Build the final mode string.
%newMode = $pref::Video::Resolution SPC %newFullScreen SPC %newBpp SPC %newRefresh SPC %newFSAA;
%newMode = $pref::Video::Resolution SPC %newFullScreen SPC %newBpp SPC %newRefresh SPC %newAA;
// Change the video mode.
if ( %newMode !$= $pref::Video::mode || %newDeviceID != $pref::Video::deviceId ||
@ -609,7 +610,7 @@ function updateDisplaySettings()
$pref::Video::deviceId = %newDeviceID;
$pref::Video::deviceMode = $Video::ModeBorderless;
%tmpModeStr = Canvas.getMonitorMode(%newDeviceID, 0);
Canvas.setVideoMode(%tmpModeStr.x, %tmpModeStr.y, false, 32, getWord(%tmpModeStr, $WORD::REFRESH), %newFSAA);
Canvas.setVideoMode(%tmpModeStr.x, %tmpModeStr.y, false, 32, getWord(%tmpModeStr, $WORD::REFRESH), %newAA);
}
$pref::Video::mode = %newMode;
@ -619,7 +620,7 @@ function updateDisplaySettings()
$pref::Video::Resolution = %newRes;
$pref::Video::FullScreen = %newFullScreen;
$pref::Video::RefreshRate = %newRefresh;
$pref::Video::AA = %newFSAA;
$pref::Video::AA = %newAA;
configureCanvas();
}
}

View file

@ -34,7 +34,7 @@ $pref::Video::screenShotSession = 0;
$pref::Video::screenShotFormat = "PNG";
/// This disables the hardware FSAA/MSAA so that
/// we depend completely on the FXAA post effect
/// we depend completely on the AA post effects
/// which works on all cards and in deferred mode.
///
/// Note the new Intel Hybrid graphics on laptops
@ -43,6 +43,8 @@ $pref::Video::screenShotFormat = "PNG";
///
$pref::Video::disableHardwareAA = true;
$pref::video::AAMode = "None";
$pref::Video::disableNormalmapping = false;
$pref::Video::disablePixSpecular = false;

View file

@ -34,6 +34,7 @@ function AssetBrowser::createShapeAsset(%this)
function AssetBrowser::editShapeAsset(%this, %assetDef)
{
%this.hideDialog();
EditorGui.setEditor( ShapeEditorPlugin );
ShapeEditorPlugin.openShapeAsset(%assetDef);
}

View file

@ -28,6 +28,7 @@ function AssetBrowser::createShapeAnimationAsset(%this)
function AssetBrowser::editShapeAnimationAsset(%this, %assetDef)
{
%this.hideDialog();
EditorGui.setEditor( ShapeEditorPlugin );
ShapeEditorPlugin.openShapeAsset(%assetDef);
}

View file

@ -20,7 +20,8 @@
# IN THE SOFTWARE.
# -----------------------------------------------------------------------------
option(TORQUE_NET_CURL "Use CURL and enable HTTPObject" ON)
option(TORQUE_NET_CURL "Use CURL and enable HTTPObject" OFF)
mark_as_advanced(TORQUE_NET_CURL)
if( NOT TORQUE_NET_CURL )
return()

View file

@ -247,7 +247,7 @@ endif()
# Always enabled paths first
###############################################################################
addPath("${srcDir}/") # must come first :)
addPathRec("${srcDir}/app")
addPath("${srcDir}/app")
addPath("${srcDir}/sfx/media")
addPath("${srcDir}/sfx/null")
addPath("${srcDir}/sfx")
@ -295,7 +295,7 @@ addPath("${srcDir}/platform/output")
addPath("${srcDir}/app")
if (NOT TORQUE_NET_CURL)
set(BLACKLIST "httpObject.h httpObject.cpp")
set(BLACKLIST "httpObject.h" "httpObject.cpp" )
endif()
addPath("${srcDir}/app/net")
set(BLACKLIST "")