clear gbuffer from code and not from a shader

This commit is contained in:
Tim Barnes 2018-10-24 18:58:46 +10:00
parent 5ef8cc912d
commit ad4c115e00
6 changed files with 7 additions and 244 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

@ -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);
}