Merge branch 'PBR_PR' of https://github.com/rextimmy/Torque3D into PBR_PR

This commit is contained in:
Azaezel 2018-10-24 20:48:45 -05:00
commit 2cd03ab765
8 changed files with 46 additions and 265 deletions

View file

@ -1,14 +1,3 @@
singleton ShaderData( ClearGBufferShader )
{
DXVertexShaderFile = "shaders/common/lighting/advanced/deferredClearGBufferV.hlsl";
DXPixelShaderFile = "shaders/common/lighting/advanced/deferredClearGBufferP.hlsl";
OGLVertexShaderFile = "shaders/common/postFx/gl/postFxV.glsl";
OGLPixelShaderFile = "shaders/common/lighting/advanced/gl/deferredClearGBufferP.glsl";
pixVersion = 2.0;
};
singleton ShaderData( DeferredColorShader )
{
DXVertexShaderFile = "shaders/common/postFx/postFxV.hlsl";

View file

@ -26,13 +26,20 @@ new GFXStateBlockData( AL_VectorLightState )
{
blendDefined = true;
blendEnable = true;
blendSrc = GFXBlendSrcAlpha;
blendSrc = GFXBlendOne;
blendDest = GFXBlendOne;
blendOp = GFXBlendOpAdd;
colorWriteDefined = true;
colorWriteRed = true;
colorWriteBlue = true;
colorWriteGreen = true;
colorWriteAlpha = false; //disable alpha write
zDefined = true;
zEnable = false;
zWriteEnable = false;
zWriteEnable = true;
zFunc = GFXCmpGreater;
samplersDefined = true;
samplerStates[0] = SamplerClampPoint; // G-buffer
@ -49,12 +56,7 @@ new GFXStateBlockData( AL_VectorLightState )
cullMode = GFXCullNone;
stencilDefined = true;
stencilEnable = true;
stencilFailOp = GFXStencilOpKeep;
stencilZFailOp = GFXStencilOpKeep;
stencilPassOp = GFXStencilOpKeep;
stencilFunc = GFXCmpLess;
stencilRef = 0;
stencilEnable = false;
};
// Vector Light Material
@ -102,14 +104,20 @@ new GFXStateBlockData( AL_ConvexLightState )
{
blendDefined = true;
blendEnable = true;
blendSrc = GFXBlendSrcAlpha;
blendSrc = GFXBlendOne;
blendDest = GFXBlendOne;
blendOp = GFXBlendOpAdd;
colorWriteDefined = true;
colorWriteRed = true;
colorWriteBlue = true;
colorWriteGreen = true;
colorWriteAlpha = false; //disable alpha write
zDefined = true;
zEnable = true;
zWriteEnable = false;
zFunc = GFXCmpGreaterEqual;
zFunc = GFXCmpGreater;
samplersDefined = true;
samplerStates[0] = SamplerClampPoint; // G-buffer
@ -125,12 +133,7 @@ new GFXStateBlockData( AL_ConvexLightState )
cullMode = GFXCullCW;
stencilDefined = true;
stencilEnable = true;
stencilFailOp = GFXStencilOpKeep;
stencilZFailOp = GFXStencilOpKeep;
stencilPassOp = GFXStencilOpKeep;
stencilFunc = GFXCmpLess;
stencilRef = 0;
stencilEnable = false;
};
// Point Light Material
@ -297,10 +300,16 @@ new GFXStateBlockData( AL_ProbeState )
{
blendDefined = true;
blendEnable = true;
blendSrc = GFXBlendSrcAlpha;
blendSrc = GFXBlendSrcAlpha; //TODO change this to GFXBlendOne once probes are done in one pass!
blendDest = GFXBlendOne;
blendOp = GFXBlendOpAdd;
colorWriteDefined = true;
colorWriteRed = true;
colorWriteBlue = true;
colorWriteGreen = true;
colorWriteAlpha = true;
zDefined = true;
zEnable = true;
zWriteEnable = false;

View file

@ -1,58 +0,0 @@
//-----------------------------------------------------------------------------
// 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 "../../shaderModel.hlsl"
struct Conn
{
float4 hpos : TORQUE_POSITION;
};
struct Fragout
{
float4 col : TORQUE_TARGET0;
float4 col1 : TORQUE_TARGET1;
float4 col2 : TORQUE_TARGET2;
float4 col3 : TORQUE_TARGET3;
};
//-----------------------------------------------------------------------------
// Main
//-----------------------------------------------------------------------------
Fragout main( Conn IN )
{
Fragout OUT;
// Clear Deferred Buffer ( Normals/Depth );
OUT.col = float4(1.0, 1.0, 1.0, 1.0);
// Clear Color Buffer.
OUT.col1 = float4(0.0, 0.0, 0.0, 0.0001);
// Clear Material Info Buffer.
OUT.col2 = float4(0.0, 0.0, 0.0, 0.0);
// Clear Light Info Buffer.
OUT.col3 = float4(0.0, 0.0, 0.0, 0.0);
return OUT;
}

View file

@ -1,43 +0,0 @@
//-----------------------------------------------------------------------------
// 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 "../../shaderModel.hlsl"
struct Appdata
{
float3 pos : POSITION;
float4 color : COLOR;
};
struct Conn
{
float4 hpos : TORQUE_POSITION;
};
uniform float4x4 modelview;
Conn main( Appdata In )
{
Conn Out;
Out.hpos = float4(In.pos,1.0);
return Out;
}

View file

@ -1,44 +0,0 @@
//-----------------------------------------------------------------------------
// 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.
//-----------------------------------------------------------------------------
out vec4 OUT_col;
out vec4 OUT_col1;
out vec4 OUT_col2;
out vec4 OUT_col3;
//-----------------------------------------------------------------------------
// Main
//-----------------------------------------------------------------------------
void main()
{
// Clear Deferred Buffer ( Normals/Depth );
OUT_col = vec4(1.0, 1.0, 1.0, 1.0);
// Clear Color Buffer.
OUT_col1 = vec4(0.0, 0.0, 0.0, 0.0001);
// Clear Material Info Buffer.
OUT_col2 = vec4(0.0, 0.0, 0.0, 0.0);
// Clear Light Info Buffer.
OUT_col3 = vec4(0.0, 0.0, 0.0, 0.0);
}