mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-21 20:35:35 +00:00
Reorg of the probe initialization/update code to streamline parts of it, and make it flow more obviously
Added some initial asset stuffs for Das Boot for building out a better testing level.
This commit is contained in:
parent
17cec11b97
commit
a552471e4e
33 changed files with 317 additions and 1821 deletions
|
|
@ -1,94 +0,0 @@
|
|||
//*****************************************************************************
|
||||
// Torque -- HLSL procedural shader
|
||||
//*****************************************************************************
|
||||
|
||||
// Dependencies:
|
||||
#include "core/rendering/shaders/torque.hlsl"
|
||||
|
||||
// Features:
|
||||
// Vert Position
|
||||
// Base Texture
|
||||
// Diffuse Color
|
||||
// Deferred Shading: Empty Specular
|
||||
// Deferred Shading: Mat Info Flags
|
||||
// Eye Space Depth (Out)
|
||||
// Visibility
|
||||
// GBuffer Conditioner
|
||||
// Deferred Material
|
||||
|
||||
struct ConnectData
|
||||
{
|
||||
float4 vpos : SV_Position;
|
||||
float2 texCoord : TEXCOORD0;
|
||||
float4 wsEyeVec : TEXCOORD1;
|
||||
float3 gbNormal : TEXCOORD2;
|
||||
};
|
||||
|
||||
|
||||
struct Fragout
|
||||
{
|
||||
float4 col : SV_Target0;
|
||||
float4 col1 : SV_Target1;
|
||||
float4 col2 : SV_Target2;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Main
|
||||
//-----------------------------------------------------------------------------
|
||||
Fragout main( ConnectData IN,
|
||||
uniform SamplerState diffuseMap : register(S0),
|
||||
uniform Texture2D diffuseMapTex : register(T0),
|
||||
uniform float4 diffuseMaterialColor : register(C0),
|
||||
uniform float matInfoFlags : register(C1),
|
||||
uniform float3 vEye : register(C3),
|
||||
uniform float4 oneOverFarplane : register(C4),
|
||||
uniform float visibility : register(C2)
|
||||
)
|
||||
{
|
||||
Fragout OUT;
|
||||
|
||||
// Vert Position
|
||||
|
||||
// Base Texture
|
||||
float4 diffuseColor = diffuseMapTex.Sample(diffuseMap, IN.texCoord);
|
||||
OUT.col1 = diffuseColor;
|
||||
|
||||
// Diffuse Color
|
||||
OUT.col1 *= diffuseMaterialColor;
|
||||
|
||||
// Deferred Shading: Empty Specular
|
||||
OUT.col2.g = 1.0;
|
||||
OUT.col2.ba = 0.0;
|
||||
|
||||
// Deferred Shading: Mat Info Flags
|
||||
OUT.col2.r = matInfoFlags;
|
||||
|
||||
// Eye Space Depth (Out)
|
||||
#ifndef CUBE_SHADOW_MAP
|
||||
float eyeSpaceDepth = dot(vEye, (IN.wsEyeVec.xyz / IN.wsEyeVec.w));
|
||||
#else
|
||||
float eyeSpaceDepth = length( IN.wsEyeVec.xyz / IN.wsEyeVec.w ) * oneOverFarplane.x;
|
||||
#endif
|
||||
|
||||
// Visibility
|
||||
fizzle( IN.vpos.xy, visibility );
|
||||
|
||||
// GBuffer Conditioner
|
||||
float4 normal_depth = float4(normalize(IN.gbNormal), eyeSpaceDepth);
|
||||
|
||||
// output buffer format: GFXFormatR16G16B16A16F
|
||||
// g-buffer conditioner: float4(normal.X, normal.Y, depth Hi, depth Lo)
|
||||
float4 _gbConditionedOutput = float4(sqrt(half(2.0/(1.0 - normal_depth.y))) * half2(normal_depth.xz), 0.0, normal_depth.a);
|
||||
|
||||
// Encode depth into hi/lo
|
||||
float2 _tempDepth = frac(normal_depth.a * float2(1.0, 65535.0));
|
||||
_gbConditionedOutput.zw = _tempDepth.xy - _tempDepth.yy * float2(1.0/65535.0, 0.0);
|
||||
|
||||
OUT.col = _gbConditionedOutput;
|
||||
|
||||
// Deferred Material
|
||||
|
||||
|
||||
return OUT;
|
||||
}
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
//*****************************************************************************
|
||||
// Torque -- HLSL procedural shader
|
||||
//*****************************************************************************
|
||||
|
||||
// Dependencies:
|
||||
#include "core/rendering/shaders/torque.hlsl"
|
||||
|
||||
// Features:
|
||||
// Vert Position
|
||||
// Base Texture
|
||||
// Diffuse Color
|
||||
// Deferred Shading: Empty Specular
|
||||
// Deferred Shading: Mat Info Flags
|
||||
// Eye Space Depth (Out)
|
||||
// Visibility
|
||||
// GBuffer Conditioner
|
||||
// Deferred Material
|
||||
|
||||
struct VertData
|
||||
{
|
||||
float3 position : POSITION;
|
||||
float3 normal : NORMAL;
|
||||
float3 T : TANGENT;
|
||||
float3 B : BINORMAL;
|
||||
float2 texCoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
|
||||
struct ConnectData
|
||||
{
|
||||
float4 hpos : SV_Position;
|
||||
float2 out_texCoord : TEXCOORD0;
|
||||
float4 wsEyeVec : TEXCOORD1;
|
||||
float3 gbNormal : TEXCOORD2;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Main
|
||||
//-----------------------------------------------------------------------------
|
||||
ConnectData main( VertData IN,
|
||||
uniform float4x4 modelview : register(C0),
|
||||
uniform float4x4 objTrans : register(C4),
|
||||
uniform float3 eyePosWorld : register(C12),
|
||||
uniform float4x4 worldViewOnly : register(C8)
|
||||
)
|
||||
{
|
||||
ConnectData OUT;
|
||||
|
||||
// Vert Position
|
||||
OUT.hpos = mul(modelview, float4(IN.position.xyz,1));
|
||||
|
||||
// Base Texture
|
||||
OUT.out_texCoord = (float2)IN.texCoord;
|
||||
|
||||
// Diffuse Color
|
||||
|
||||
// Deferred Shading: Empty Specular
|
||||
|
||||
// Deferred Shading: Mat Info Flags
|
||||
|
||||
// Eye Space Depth (Out)
|
||||
float3 depthPos = mul( objTrans, float4( IN.position.xyz, 1 ) ).xyz;
|
||||
OUT.wsEyeVec = float4( depthPos.xyz - eyePosWorld, 1 );
|
||||
|
||||
// Visibility
|
||||
|
||||
// GBuffer Conditioner
|
||||
OUT.gbNormal = mul(worldViewOnly, float4( normalize(IN.normal), 0.0 ) ).xyz;
|
||||
|
||||
// Deferred Material
|
||||
|
||||
return OUT;
|
||||
}
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
//*****************************************************************************
|
||||
// Torque -- HLSL procedural shader
|
||||
//*****************************************************************************
|
||||
|
||||
// Dependencies:
|
||||
#include "core/rendering/shaders/torque.hlsl"
|
||||
|
||||
// Features:
|
||||
// Vert Position
|
||||
// Eye Space Depth (Out)
|
||||
// Visibility
|
||||
|
||||
struct ConnectData
|
||||
{
|
||||
float4 vpos : SV_Position;
|
||||
float4 wsEyeVec : TEXCOORD0;
|
||||
};
|
||||
|
||||
|
||||
struct Fragout
|
||||
{
|
||||
float4 col : SV_Target0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Main
|
||||
//-----------------------------------------------------------------------------
|
||||
Fragout main( ConnectData IN,
|
||||
uniform float3 vEye : register(C1),
|
||||
uniform float4 oneOverFarplane : register(C2),
|
||||
uniform float visibility : register(C0)
|
||||
)
|
||||
{
|
||||
Fragout OUT;
|
||||
|
||||
// Vert Position
|
||||
|
||||
// Eye Space Depth (Out)
|
||||
#ifndef CUBE_SHADOW_MAP
|
||||
float eyeSpaceDepth = dot(vEye, (IN.wsEyeVec.xyz / IN.wsEyeVec.w));
|
||||
#else
|
||||
float eyeSpaceDepth = length( IN.wsEyeVec.xyz / IN.wsEyeVec.w ) * oneOverFarplane.x;
|
||||
#endif
|
||||
OUT.col = float4(eyeSpaceDepth.rrr,1);
|
||||
|
||||
// Visibility
|
||||
fizzle( IN.vpos.xy, visibility );
|
||||
|
||||
|
||||
return OUT;
|
||||
}
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
//*****************************************************************************
|
||||
// Torque -- HLSL procedural shader
|
||||
//*****************************************************************************
|
||||
|
||||
// Dependencies:
|
||||
#include "core/rendering/shaders/torque.hlsl"
|
||||
|
||||
// Features:
|
||||
// Vert Position
|
||||
// Eye Space Depth (Out)
|
||||
// Visibility
|
||||
|
||||
struct VertData
|
||||
{
|
||||
float3 position : POSITION;
|
||||
float3 normal : NORMAL;
|
||||
float3 T : TANGENT;
|
||||
float3 B : BINORMAL;
|
||||
float2 texCoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
|
||||
struct ConnectData
|
||||
{
|
||||
float4 hpos : SV_Position;
|
||||
float4 wsEyeVec : TEXCOORD0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Main
|
||||
//-----------------------------------------------------------------------------
|
||||
ConnectData main( VertData IN,
|
||||
uniform float4x4 modelview : register(C0),
|
||||
uniform float4x4 objTrans : register(C4),
|
||||
uniform float3 eyePosWorld : register(C8)
|
||||
)
|
||||
{
|
||||
ConnectData OUT;
|
||||
|
||||
// Vert Position
|
||||
OUT.hpos = mul(modelview, float4(IN.position.xyz,1));
|
||||
|
||||
// Eye Space Depth (Out)
|
||||
float3 depthPos = mul( objTrans, float4( IN.position.xyz, 1 ) ).xyz;
|
||||
OUT.wsEyeVec = float4( depthPos.xyz - eyePosWorld, 1 );
|
||||
|
||||
// Visibility
|
||||
|
||||
return OUT;
|
||||
}
|
||||
|
|
@ -1,72 +0,0 @@
|
|||
//*****************************************************************************
|
||||
// Torque -- HLSL procedural shader
|
||||
//*****************************************************************************
|
||||
|
||||
// Dependencies:
|
||||
#include "core/rendering/shaders/lighting.hlsl"
|
||||
#include "core/rendering/shaders/torque.hlsl"
|
||||
|
||||
// Features:
|
||||
// Vert Position
|
||||
// Diffuse Color
|
||||
// Deferred RT Lighting
|
||||
// Visibility
|
||||
// HDR Output
|
||||
|
||||
struct ConnectData
|
||||
{
|
||||
float4 vpos : SV_Position;
|
||||
float3 wsNormal : TEXCOORD0;
|
||||
float3 wsPosition : TEXCOORD1;
|
||||
};
|
||||
|
||||
|
||||
struct Fragout
|
||||
{
|
||||
float4 col : SV_Target0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Main
|
||||
//-----------------------------------------------------------------------------
|
||||
Fragout main( ConnectData IN,
|
||||
uniform float4 diffuseMaterialColor : register(C0),
|
||||
uniform float3 eyePosWorld : register(C17),
|
||||
uniform float4 inLightPos[3] : register(C1),
|
||||
uniform float4 inLightInvRadiusSq : register(C4),
|
||||
uniform float4 inLightColor[4] : register(C5),
|
||||
uniform float4 inLightSpotDir[3] : register(C9),
|
||||
uniform float4 inLightSpotAngle : register(C12),
|
||||
uniform float4 inLightSpotFalloff : register(C13),
|
||||
uniform float smoothness : register(C14),
|
||||
uniform float metalness : register(C15),
|
||||
uniform float4 ambient : register(C18),
|
||||
uniform float visibility : register(C16)
|
||||
)
|
||||
{
|
||||
Fragout OUT;
|
||||
|
||||
// Vert Position
|
||||
|
||||
// Diffuse Color
|
||||
OUT.col = diffuseMaterialColor;
|
||||
|
||||
// Deferred RT Lighting
|
||||
IN.wsNormal = normalize( half3( IN.wsNormal ) );
|
||||
float3 wsView = normalize( eyePosWorld - IN.wsPosition );
|
||||
float4 rtShading; float4 specular;
|
||||
compute4Lights( wsView, IN.wsPosition, IN.wsNormal, float4( 1, 1, 1, 1 ),
|
||||
inLightPos, inLightInvRadiusSq, inLightColor, inLightSpotDir, inLightSpotAngle, inLightSpotFalloff, smoothness, metalness, OUT.col,
|
||||
rtShading, specular );
|
||||
OUT.col *= float4( rtShading.rgb + ambient.rgb, 1 );
|
||||
|
||||
// Visibility
|
||||
fizzle( IN.vpos.xy, visibility );
|
||||
|
||||
// HDR Output
|
||||
OUT.col = hdrEncode( OUT.col );
|
||||
|
||||
|
||||
return OUT;
|
||||
}
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
//*****************************************************************************
|
||||
// Torque -- HLSL procedural shader
|
||||
//*****************************************************************************
|
||||
|
||||
// Dependencies:
|
||||
#include "core/rendering/shaders/lighting.hlsl"
|
||||
#include "core/rendering/shaders/torque.hlsl"
|
||||
|
||||
// Features:
|
||||
// Vert Position
|
||||
// Diffuse Color
|
||||
// Deferred RT Lighting
|
||||
// Visibility
|
||||
// HDR Output
|
||||
|
||||
struct VertData
|
||||
{
|
||||
float3 position : POSITION;
|
||||
float3 normal : NORMAL;
|
||||
float3 T : TANGENT;
|
||||
float3 B : BINORMAL;
|
||||
float2 texCoord : TEXCOORD0;
|
||||
float2 texCoord2 : TEXCOORD1;
|
||||
};
|
||||
|
||||
|
||||
struct ConnectData
|
||||
{
|
||||
float4 hpos : SV_Position;
|
||||
float3 wsNormal : TEXCOORD0;
|
||||
float3 outWsPosition : TEXCOORD1;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Main
|
||||
//-----------------------------------------------------------------------------
|
||||
ConnectData main( VertData IN,
|
||||
uniform float4x4 modelview : register(C0),
|
||||
uniform float4x4 objTrans : register(C4)
|
||||
)
|
||||
{
|
||||
ConnectData OUT;
|
||||
|
||||
// Vert Position
|
||||
OUT.hpos = mul(modelview, float4(IN.position.xyz,1));
|
||||
|
||||
// Diffuse Color
|
||||
|
||||
// Deferred RT Lighting
|
||||
OUT.wsNormal = mul( objTrans, float4( normalize( IN.normal ), 0.0 ) ).xyz;
|
||||
OUT.outWsPosition = mul( objTrans, float4( IN.position.xyz, 1 ) ).xyz;
|
||||
|
||||
// Visibility
|
||||
|
||||
// HDR Output
|
||||
|
||||
return OUT;
|
||||
}
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
//*****************************************************************************
|
||||
// Torque -- HLSL procedural shader
|
||||
//*****************************************************************************
|
||||
|
||||
// Dependencies:
|
||||
#include "core/rendering/shaders/torque.hlsl"
|
||||
|
||||
// Features:
|
||||
// Vert Position
|
||||
// skybox
|
||||
// Diffuse Color
|
||||
// Reflect Cube
|
||||
// HDR Output
|
||||
|
||||
struct ConnectData
|
||||
{
|
||||
float4 vpos : SV_Position;
|
||||
float3 reflectVec : TEXCOORD0;
|
||||
};
|
||||
|
||||
|
||||
struct Fragout
|
||||
{
|
||||
float4 col : SV_Target0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Main
|
||||
//-----------------------------------------------------------------------------
|
||||
Fragout main( ConnectData IN,
|
||||
uniform float4 diffuseMaterialColor : register(C0),
|
||||
uniform SamplerState cubeMap : register(S0),
|
||||
uniform TextureCube cubeMapTex : register(T0)
|
||||
)
|
||||
{
|
||||
Fragout OUT;
|
||||
|
||||
// Vert Position
|
||||
|
||||
// skybox
|
||||
|
||||
// Diffuse Color
|
||||
OUT.col = diffuseMaterialColor;
|
||||
|
||||
// Reflect Cube
|
||||
OUT.col *= cubeMapTex.Sample( cubeMap, IN.reflectVec );
|
||||
|
||||
// HDR Output
|
||||
OUT.col = hdrEncode( OUT.col );
|
||||
|
||||
|
||||
return OUT;
|
||||
}
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
//*****************************************************************************
|
||||
// Torque -- HLSL procedural shader
|
||||
//*****************************************************************************
|
||||
|
||||
// Dependencies:
|
||||
#include "core/rendering/shaders/torque.hlsl"
|
||||
|
||||
// Features:
|
||||
// Vert Position
|
||||
// skybox
|
||||
// Diffuse Color
|
||||
// Reflect Cube
|
||||
// HDR Output
|
||||
|
||||
struct VertData
|
||||
{
|
||||
float3 position : POSITION;
|
||||
float3 normal : NORMAL;
|
||||
float2 texCoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
|
||||
struct ConnectData
|
||||
{
|
||||
float4 hpos : SV_Position;
|
||||
float3 reflectVec : TEXCOORD0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Main
|
||||
//-----------------------------------------------------------------------------
|
||||
ConnectData main( VertData IN,
|
||||
uniform float4x4 modelview : register(C0),
|
||||
uniform float4x4 objTrans : register(C4),
|
||||
uniform float3 eyePosWorld : register(C8)
|
||||
)
|
||||
{
|
||||
ConnectData OUT;
|
||||
|
||||
// Vert Position
|
||||
OUT.hpos = mul(modelview, float4(IN.position.xyz,1));
|
||||
|
||||
// skybox
|
||||
|
||||
// Diffuse Color
|
||||
|
||||
// Reflect Cube
|
||||
float3 cubeVertPos = mul(objTrans, float4(IN.position,1)).xyz;
|
||||
float3 cubeNormal = ( mul( (objTrans), float4(IN.normal, 0) ) ).xyz;
|
||||
cubeNormal = bool(length(cubeNormal)) ? normalize(cubeNormal) : cubeNormal;
|
||||
float3 eyeToVert = cubeVertPos - eyePosWorld;
|
||||
OUT.reflectVec = reflect(eyeToVert, cubeNormal);
|
||||
|
||||
// HDR Output
|
||||
|
||||
return OUT;
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// Autogenerated 'GBuffer Conditioner' Condition Method
|
||||
//------------------------------------------------------------------------------
|
||||
vec4 autogenCondition_55070f7a(vec4 unconditionedOutput)
|
||||
{
|
||||
// g-buffer conditioner: float4(normal.X, normal.Y, depth Hi, depth Lo)
|
||||
float4 _gbConditionedOutput = float4(sqrt(half(2.0/(1.0 - unconditionedOutput.y))) * half2(unconditionedOutput.xz), 0.0, unconditionedOutput.a);
|
||||
|
||||
// Encode depth into hi/lo
|
||||
float2 _tempDepth = frac(unconditionedOutput.a * float2(1.0, 65535.0));
|
||||
_gbConditionedOutput.zw = _tempDepth.xy - _tempDepth.yy * float2(1.0/65535.0, 0.0);
|
||||
|
||||
|
||||
return _gbConditionedOutput;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Autogenerated 'GBuffer Conditioner' Uncondition Method
|
||||
//------------------------------------------------------------------------------
|
||||
float4 autogenUncondition_55070f7a(sampler2D deferredSamplerVar, float2 screenUVVar)
|
||||
{
|
||||
// Sampler g-buffer
|
||||
float4 bufferSample = tex2Dlod(deferredSamplerVar, float4(screenUVVar,0,0));
|
||||
// g-buffer unconditioner: float4(normal.X, normal.Y, depth Hi, depth Lo)
|
||||
float2 _inpXY = bufferSample.xy;
|
||||
float _xySQ = dot(_inpXY, _inpXY);
|
||||
float4 _gbUnconditionedInput = float4( sqrt(half(1.0 - (_xySQ / 4.0))) * _inpXY, -1.0 + (_xySQ / 2.0), bufferSample.a).xzyw;
|
||||
|
||||
// Decode depth
|
||||
_gbUnconditionedInput.w = dot( bufferSample.zw, float2(1.0, 1.0/65535.0));
|
||||
|
||||
return _gbUnconditionedInput;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
//*****************************************************************************
|
||||
// Torque -- HLSL procedural shader
|
||||
//*****************************************************************************
|
||||
|
||||
// Dependencies:
|
||||
#include "core/rendering/shaders/lighting.hlsl"
|
||||
//------------------------------------------------------------------------------
|
||||
// Autogenerated 'Light Buffer Conditioner [RGB]' Uncondition Method
|
||||
//------------------------------------------------------------------------------
|
||||
inline void autogenUncondition_bde4cbab(in float4 bufferSample, out float3 lightColor, out float NL_att, out float specular)
|
||||
{
|
||||
lightColor = bufferSample.rgb;
|
||||
NL_att = dot(bufferSample.rgb, float3(0.3576, 0.7152, 0.1192));
|
||||
specular = bufferSample.a;
|
||||
}
|
||||
|
||||
|
||||
#include "core/rendering/shaders/torque.hlsl"
|
||||
|
||||
// Features:
|
||||
// Vert Position
|
||||
// Base Texture
|
||||
// Deferred RT Lighting
|
||||
// Visibility
|
||||
// HDR Output
|
||||
|
||||
struct ConnectData
|
||||
{
|
||||
float4 vpos : SV_Position;
|
||||
float2 texCoord : TEXCOORD0;
|
||||
float4 screenspacePos : TEXCOORD1;
|
||||
};
|
||||
|
||||
|
||||
struct Fragout
|
||||
{
|
||||
float4 col : SV_Target0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Main
|
||||
//-----------------------------------------------------------------------------
|
||||
Fragout main( ConnectData IN,
|
||||
uniform SamplerState diffuseMap : register(S0),
|
||||
uniform Texture2D diffuseMapTex : register(T0),
|
||||
uniform float4 rtParamslightInfoBuffer : register(C1),
|
||||
uniform SamplerState lightInfoBuffer : register(S1),
|
||||
uniform Texture2D lightInfoBufferTex : register(T1),
|
||||
uniform float visibility : register(C0)
|
||||
)
|
||||
{
|
||||
Fragout OUT;
|
||||
|
||||
// Vert Position
|
||||
|
||||
// Base Texture
|
||||
float4 diffuseColor = diffuseMapTex.Sample(diffuseMap, IN.texCoord);
|
||||
OUT.col = diffuseColor;
|
||||
|
||||
// Deferred RT Lighting
|
||||
float2 uvScene = IN.screenspacePos.xy / IN.screenspacePos.w;
|
||||
uvScene = ( uvScene + 1.0 ) / 2.0;
|
||||
uvScene.y = 1.0 - uvScene.y;
|
||||
uvScene = ( uvScene * rtParamslightInfoBuffer.zw ) + rtParamslightInfoBuffer.xy;
|
||||
float3 d_lightcolor;
|
||||
float d_NL_Att;
|
||||
float d_specular;
|
||||
lightinfoUncondition(lightInfoBufferTex.Sample(lightInfoBuffer, uvScene), d_lightcolor, d_NL_Att, d_specular);
|
||||
OUT.col *= float4(d_lightcolor, 1.0);
|
||||
|
||||
// Visibility
|
||||
fizzle( IN.vpos.xy, visibility );
|
||||
|
||||
// HDR Output
|
||||
OUT.col = hdrEncode( OUT.col );
|
||||
|
||||
|
||||
return OUT;
|
||||
}
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
//*****************************************************************************
|
||||
// Torque -- HLSL procedural shader
|
||||
//*****************************************************************************
|
||||
|
||||
// Dependencies:
|
||||
#include "core/rendering/shaders/lighting.hlsl"
|
||||
#include "core/rendering/shaders/torque.hlsl"
|
||||
|
||||
// Features:
|
||||
// Vert Position
|
||||
// Base Texture
|
||||
// Deferred RT Lighting
|
||||
// Visibility
|
||||
// HDR Output
|
||||
|
||||
struct VertData
|
||||
{
|
||||
float3 position : POSITION;
|
||||
float3 normal : NORMAL;
|
||||
float3 T : TANGENT;
|
||||
float3 B : BINORMAL;
|
||||
float2 texCoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
|
||||
struct ConnectData
|
||||
{
|
||||
float4 hpos : SV_Position;
|
||||
float2 out_texCoord : TEXCOORD0;
|
||||
float4 screenspacePos : TEXCOORD1;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Main
|
||||
//-----------------------------------------------------------------------------
|
||||
ConnectData main( VertData IN,
|
||||
uniform float4x4 modelview : register(C0)
|
||||
)
|
||||
{
|
||||
ConnectData OUT;
|
||||
|
||||
// Vert Position
|
||||
OUT.hpos = mul(modelview, float4(IN.position.xyz,1));
|
||||
|
||||
// Base Texture
|
||||
OUT.out_texCoord = (float2)IN.texCoord;
|
||||
|
||||
// Deferred RT Lighting
|
||||
OUT.screenspacePos = OUT.hpos;
|
||||
|
||||
// Visibility
|
||||
|
||||
// HDR Output
|
||||
|
||||
return OUT;
|
||||
}
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
//*****************************************************************************
|
||||
// Torque -- HLSL procedural shader
|
||||
//*****************************************************************************
|
||||
|
||||
// Dependencies:
|
||||
#include "core/rendering/shaders/torque.hlsl"
|
||||
|
||||
// Features:
|
||||
// Vert Position
|
||||
// Diffuse Color
|
||||
// Deferred Shading: Empty Specular
|
||||
// Deferred Shading: Mat Info Flags
|
||||
// Eye Space Depth (Out)
|
||||
// Visibility
|
||||
// GBuffer Conditioner
|
||||
// Deferred Material
|
||||
|
||||
struct ConnectData
|
||||
{
|
||||
float4 vpos : SV_Position;
|
||||
float4 wsEyeVec : TEXCOORD0;
|
||||
float3 gbNormal : TEXCOORD1;
|
||||
};
|
||||
|
||||
|
||||
struct Fragout
|
||||
{
|
||||
float4 col : SV_Target0;
|
||||
float4 col1 : SV_Target1;
|
||||
float4 col2 : SV_Target2;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Main
|
||||
//-----------------------------------------------------------------------------
|
||||
Fragout main( ConnectData IN,
|
||||
uniform float4 diffuseMaterialColor : register(C0),
|
||||
uniform float matInfoFlags : register(C1),
|
||||
uniform float3 vEye : register(C3),
|
||||
uniform float4 oneOverFarplane : register(C4),
|
||||
uniform float visibility : register(C2)
|
||||
)
|
||||
{
|
||||
Fragout OUT;
|
||||
|
||||
// Vert Position
|
||||
|
||||
// Diffuse Color
|
||||
OUT.col1 = float4(1.0,1.0,1.0,1.0);
|
||||
OUT.col1 = diffuseMaterialColor;
|
||||
|
||||
// Deferred Shading: Empty Specular
|
||||
OUT.col2.g = 1.0;
|
||||
OUT.col2.ba = 0.0;
|
||||
|
||||
// Deferred Shading: Mat Info Flags
|
||||
OUT.col2.r = matInfoFlags;
|
||||
|
||||
// Eye Space Depth (Out)
|
||||
#ifndef CUBE_SHADOW_MAP
|
||||
float eyeSpaceDepth = dot(vEye, (IN.wsEyeVec.xyz / IN.wsEyeVec.w));
|
||||
#else
|
||||
float eyeSpaceDepth = length( IN.wsEyeVec.xyz / IN.wsEyeVec.w ) * oneOverFarplane.x;
|
||||
#endif
|
||||
|
||||
// Visibility
|
||||
fizzle( IN.vpos.xy, visibility );
|
||||
|
||||
// GBuffer Conditioner
|
||||
float4 normal_depth = float4(normalize(IN.gbNormal), eyeSpaceDepth);
|
||||
|
||||
// output buffer format: GFXFormatR16G16B16A16F
|
||||
// g-buffer conditioner: float4(normal.X, normal.Y, depth Hi, depth Lo)
|
||||
float4 _gbConditionedOutput = float4(sqrt(half(2.0/(1.0 - normal_depth.y))) * half2(normal_depth.xz), 0.0, normal_depth.a);
|
||||
|
||||
// Encode depth into hi/lo
|
||||
float2 _tempDepth = frac(normal_depth.a * float2(1.0, 65535.0));
|
||||
_gbConditionedOutput.zw = _tempDepth.xy - _tempDepth.yy * float2(1.0/65535.0, 0.0);
|
||||
|
||||
OUT.col = _gbConditionedOutput;
|
||||
|
||||
// Deferred Material
|
||||
|
||||
|
||||
return OUT;
|
||||
}
|
||||
|
|
@ -1,70 +0,0 @@
|
|||
//*****************************************************************************
|
||||
// Torque -- HLSL procedural shader
|
||||
//*****************************************************************************
|
||||
|
||||
// Dependencies:
|
||||
#include "core/rendering/shaders/torque.hlsl"
|
||||
|
||||
// Features:
|
||||
// Vert Position
|
||||
// Diffuse Color
|
||||
// Deferred Shading: Empty Specular
|
||||
// Deferred Shading: Mat Info Flags
|
||||
// Eye Space Depth (Out)
|
||||
// Visibility
|
||||
// GBuffer Conditioner
|
||||
// Deferred Material
|
||||
|
||||
struct VertData
|
||||
{
|
||||
float3 position : POSITION;
|
||||
float3 normal : NORMAL;
|
||||
float3 T : TANGENT;
|
||||
float3 B : BINORMAL;
|
||||
float2 texCoord : TEXCOORD0;
|
||||
float2 texCoord2 : TEXCOORD1;
|
||||
};
|
||||
|
||||
|
||||
struct ConnectData
|
||||
{
|
||||
float4 hpos : SV_Position;
|
||||
float4 wsEyeVec : TEXCOORD0;
|
||||
float3 gbNormal : TEXCOORD1;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Main
|
||||
//-----------------------------------------------------------------------------
|
||||
ConnectData main( VertData IN,
|
||||
uniform float4x4 modelview : register(C0),
|
||||
uniform float4x4 objTrans : register(C4),
|
||||
uniform float3 eyePosWorld : register(C12),
|
||||
uniform float4x4 worldViewOnly : register(C8)
|
||||
)
|
||||
{
|
||||
ConnectData OUT;
|
||||
|
||||
// Vert Position
|
||||
OUT.hpos = mul(modelview, float4(IN.position.xyz,1));
|
||||
|
||||
// Diffuse Color
|
||||
|
||||
// Deferred Shading: Empty Specular
|
||||
|
||||
// Deferred Shading: Mat Info Flags
|
||||
|
||||
// Eye Space Depth (Out)
|
||||
float3 depthPos = mul( objTrans, float4( IN.position.xyz, 1 ) ).xyz;
|
||||
OUT.wsEyeVec = float4( depthPos.xyz - eyePosWorld, 1 );
|
||||
|
||||
// Visibility
|
||||
|
||||
// GBuffer Conditioner
|
||||
OUT.gbNormal = mul(worldViewOnly, float4( normalize(IN.normal), 0.0 ) ).xyz;
|
||||
|
||||
// Deferred Material
|
||||
|
||||
return OUT;
|
||||
}
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
//*****************************************************************************
|
||||
// Torque -- HLSL procedural shader
|
||||
//*****************************************************************************
|
||||
|
||||
// Dependencies:
|
||||
#include "core/rendering/shaders/torque.hlsl"
|
||||
|
||||
// Features:
|
||||
// Paraboloid Vert Transform
|
||||
// Visibility
|
||||
// Depth (Out)
|
||||
|
||||
struct ConnectData
|
||||
{
|
||||
float4 vpos : SV_Position;
|
||||
float2 posXY : TEXCOORD0;
|
||||
float depth : TEXCOORD1;
|
||||
};
|
||||
|
||||
|
||||
struct Fragout
|
||||
{
|
||||
float4 col : SV_Target0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Main
|
||||
//-----------------------------------------------------------------------------
|
||||
Fragout main( ConnectData IN,
|
||||
uniform float visibility : register(C0)
|
||||
)
|
||||
{
|
||||
Fragout OUT;
|
||||
|
||||
// Paraboloid Vert Transform
|
||||
clip( 1.0 - abs(IN.posXY.x) );
|
||||
|
||||
// Visibility
|
||||
fizzle( IN.vpos.xy, visibility );
|
||||
|
||||
// Depth (Out)
|
||||
OUT.col = float4( IN.depth, 0, 0, 1 );
|
||||
|
||||
|
||||
return OUT;
|
||||
}
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
//*****************************************************************************
|
||||
// Torque -- HLSL procedural shader
|
||||
//*****************************************************************************
|
||||
|
||||
// Dependencies:
|
||||
#include "core/rendering/shaders/torque.hlsl"
|
||||
|
||||
// Features:
|
||||
// Paraboloid Vert Transform
|
||||
// Visibility
|
||||
// Depth (Out)
|
||||
|
||||
struct VertData
|
||||
{
|
||||
float3 position : POSITION;
|
||||
float3 normal : NORMAL;
|
||||
float3 T : TANGENT;
|
||||
float3 B : BINORMAL;
|
||||
float2 texCoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
|
||||
struct ConnectData
|
||||
{
|
||||
float4 hpos : SV_Position;
|
||||
float2 posXY : TEXCOORD0;
|
||||
float depth : TEXCOORD1;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Main
|
||||
//-----------------------------------------------------------------------------
|
||||
ConnectData main( VertData IN,
|
||||
uniform float2 atlasScale : register(C4),
|
||||
uniform float4x4 worldViewOnly : register(C0),
|
||||
uniform float4 lightParams : register(C5),
|
||||
uniform float2 atlasXOffset : register(C6)
|
||||
)
|
||||
{
|
||||
ConnectData OUT;
|
||||
|
||||
// Paraboloid Vert Transform
|
||||
OUT.hpos = mul(worldViewOnly, float4(IN.position.xyz,1)).xzyw;
|
||||
float L = length(OUT.hpos.xyz);
|
||||
OUT.hpos /= L;
|
||||
OUT.hpos.z = OUT.hpos.z + 1.0;
|
||||
OUT.hpos.xy /= OUT.hpos.z;
|
||||
OUT.hpos.z = L / lightParams.x;
|
||||
OUT.hpos.w = 1.0;
|
||||
OUT.posXY = OUT.hpos.xy;
|
||||
OUT.hpos.xy *= atlasScale.xy;
|
||||
OUT.hpos.xy += atlasXOffset;
|
||||
|
||||
// Visibility
|
||||
|
||||
// Depth (Out)
|
||||
OUT.depth = OUT.hpos.z / OUT.hpos.w;
|
||||
|
||||
return OUT;
|
||||
}
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
//*****************************************************************************
|
||||
// Torque -- HLSL procedural shader
|
||||
//*****************************************************************************
|
||||
|
||||
// Dependencies:
|
||||
#include "core/rendering/shaders/torque.hlsl"
|
||||
|
||||
// Features:
|
||||
// Vert Position
|
||||
// Eye Space Depth (Out)
|
||||
// Visibility
|
||||
|
||||
struct ConnectData
|
||||
{
|
||||
float4 vpos : SV_Position;
|
||||
float4 wsEyeVec : TEXCOORD0;
|
||||
};
|
||||
|
||||
|
||||
struct Fragout
|
||||
{
|
||||
float4 col : SV_Target0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Main
|
||||
//-----------------------------------------------------------------------------
|
||||
Fragout main( ConnectData IN,
|
||||
uniform float3 vEye : register(C1),
|
||||
uniform float4 oneOverFarplane : register(C2),
|
||||
uniform float visibility : register(C0)
|
||||
)
|
||||
{
|
||||
Fragout OUT;
|
||||
|
||||
// Vert Position
|
||||
|
||||
// Eye Space Depth (Out)
|
||||
#ifndef CUBE_SHADOW_MAP
|
||||
float eyeSpaceDepth = dot(vEye, (IN.wsEyeVec.xyz / IN.wsEyeVec.w));
|
||||
#else
|
||||
float eyeSpaceDepth = length( IN.wsEyeVec.xyz / IN.wsEyeVec.w ) * oneOverFarplane.x;
|
||||
#endif
|
||||
OUT.col = float4(eyeSpaceDepth.rrr,1);
|
||||
|
||||
// Visibility
|
||||
fizzle( IN.vpos.xy, visibility );
|
||||
|
||||
|
||||
return OUT;
|
||||
}
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
//*****************************************************************************
|
||||
// Torque -- HLSL procedural shader
|
||||
//*****************************************************************************
|
||||
|
||||
// Dependencies:
|
||||
#include "core/rendering/shaders/torque.hlsl"
|
||||
|
||||
// Features:
|
||||
// Vert Position
|
||||
// Eye Space Depth (Out)
|
||||
// Visibility
|
||||
|
||||
struct VertData
|
||||
{
|
||||
float3 position : POSITION;
|
||||
float3 normal : NORMAL;
|
||||
float3 T : TANGENT;
|
||||
float3 B : BINORMAL;
|
||||
float2 texCoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
|
||||
struct ConnectData
|
||||
{
|
||||
float4 hpos : SV_Position;
|
||||
float4 wsEyeVec : TEXCOORD0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Main
|
||||
//-----------------------------------------------------------------------------
|
||||
ConnectData main( VertData IN,
|
||||
uniform float4x4 modelview : register(C0),
|
||||
uniform float4x4 objTrans : register(C4),
|
||||
uniform float3 eyePosWorld : register(C8)
|
||||
)
|
||||
{
|
||||
ConnectData OUT;
|
||||
|
||||
// Vert Position
|
||||
OUT.hpos = mul(modelview, float4(IN.position.xyz,1));
|
||||
|
||||
// Eye Space Depth (Out)
|
||||
float3 depthPos = mul( objTrans, float4( IN.position.xyz, 1 ) ).xyz;
|
||||
OUT.wsEyeVec = float4( depthPos.xyz - eyePosWorld, 1 );
|
||||
|
||||
// Visibility
|
||||
|
||||
return OUT;
|
||||
}
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
//*****************************************************************************
|
||||
// Torque -- HLSL procedural shader
|
||||
//*****************************************************************************
|
||||
|
||||
// Dependencies:
|
||||
#include "core/rendering/shaders/torque.hlsl"
|
||||
|
||||
// Features:
|
||||
// Vert Position
|
||||
// Diffuse Color
|
||||
// Diffuse Vertex Color
|
||||
// Visibility
|
||||
// Fog
|
||||
// HDR Output
|
||||
// Forward Shaded Material
|
||||
// Translucent
|
||||
|
||||
struct ConnectData
|
||||
{
|
||||
float4 vpos : SV_Position;
|
||||
float4 vertColor : COLOR;
|
||||
float3 wsPosition : TEXCOORD0;
|
||||
};
|
||||
|
||||
|
||||
struct Fragout
|
||||
{
|
||||
float4 col : SV_Target0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Main
|
||||
//-----------------------------------------------------------------------------
|
||||
Fragout main( ConnectData IN,
|
||||
uniform float4 diffuseMaterialColor : register(C0),
|
||||
uniform float visibility : register(C1),
|
||||
uniform float4 fogColor : register(C2),
|
||||
uniform float3 eyePosWorld : register(C3),
|
||||
uniform float3 fogData : register(C4)
|
||||
)
|
||||
{
|
||||
Fragout OUT;
|
||||
|
||||
// Vert Position
|
||||
|
||||
// Diffuse Color
|
||||
OUT.col = diffuseMaterialColor;
|
||||
|
||||
// Diffuse Vertex Color
|
||||
OUT.col *= IN.vertColor;
|
||||
|
||||
// Visibility
|
||||
OUT.col.a *= visibility;
|
||||
|
||||
// Fog
|
||||
float fogAmount = saturate( computeSceneFog( eyePosWorld, IN.wsPosition, fogData.r, fogData.g, fogData.b ) );
|
||||
OUT.col.rgb = lerp( fogColor.rgb, OUT.col.rgb, fogAmount );
|
||||
|
||||
// HDR Output
|
||||
OUT.col = hdrEncode( OUT.col );
|
||||
|
||||
// Forward Shaded Material
|
||||
|
||||
// Translucent
|
||||
|
||||
|
||||
return OUT;
|
||||
}
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
//*****************************************************************************
|
||||
// Torque -- HLSL procedural shader
|
||||
//*****************************************************************************
|
||||
|
||||
// Dependencies:
|
||||
#include "core/rendering/shaders/torque.hlsl"
|
||||
|
||||
// Features:
|
||||
// Vert Position
|
||||
// Diffuse Color
|
||||
// Diffuse Vertex Color
|
||||
// Visibility
|
||||
// Fog
|
||||
// HDR Output
|
||||
// Forward Shaded Material
|
||||
// Translucent
|
||||
|
||||
struct VertData
|
||||
{
|
||||
float3 position : POSITION;
|
||||
float4 diffuse : COLOR;
|
||||
};
|
||||
|
||||
|
||||
struct ConnectData
|
||||
{
|
||||
float4 hpos : SV_Position;
|
||||
float4 vertColor : COLOR;
|
||||
float3 outWsPosition : TEXCOORD0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Main
|
||||
//-----------------------------------------------------------------------------
|
||||
ConnectData main( VertData IN,
|
||||
uniform float4x4 modelview : register(C0),
|
||||
uniform float4x4 objTrans : register(C4)
|
||||
)
|
||||
{
|
||||
ConnectData OUT;
|
||||
|
||||
// Vert Position
|
||||
OUT.hpos = mul(modelview, float4(IN.position.xyz,1));
|
||||
|
||||
// Diffuse Color
|
||||
|
||||
// Diffuse Vertex Color
|
||||
OUT.vertColor = IN.diffuse;
|
||||
|
||||
// Visibility
|
||||
|
||||
// Fog
|
||||
OUT.outWsPosition = mul( objTrans, float4( IN.position.xyz, 1 ) ).xyz;
|
||||
|
||||
// HDR Output
|
||||
|
||||
// Forward Shaded Material
|
||||
|
||||
// Translucent
|
||||
|
||||
return OUT;
|
||||
}
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
//*****************************************************************************
|
||||
// Torque -- HLSL procedural shader
|
||||
//*****************************************************************************
|
||||
|
||||
// Dependencies:
|
||||
#include "core/rendering/shaders/torque.hlsl"
|
||||
|
||||
// Features:
|
||||
// Paraboloid Vert Transform
|
||||
// Visibility
|
||||
// Depth (Out)
|
||||
// Single Pass Paraboloid
|
||||
|
||||
struct ConnectData
|
||||
{
|
||||
float4 vpos : SV_Position;
|
||||
float isBack : TEXCOORD0;
|
||||
float2 posXY : TEXCOORD1;
|
||||
float depth : TEXCOORD2;
|
||||
};
|
||||
|
||||
|
||||
struct Fragout
|
||||
{
|
||||
float4 col : SV_Target0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Main
|
||||
//-----------------------------------------------------------------------------
|
||||
Fragout main( ConnectData IN,
|
||||
uniform float visibility : register(C0)
|
||||
)
|
||||
{
|
||||
Fragout OUT;
|
||||
|
||||
// Paraboloid Vert Transform
|
||||
clip( abs( IN.isBack ) - 0.999 );
|
||||
clip( 1.0 - abs(IN.posXY.x) );
|
||||
|
||||
// Visibility
|
||||
fizzle( IN.vpos.xy, visibility );
|
||||
|
||||
// Depth (Out)
|
||||
OUT.col = float4( IN.depth, 0, 0, 1 );
|
||||
|
||||
// Single Pass Paraboloid
|
||||
|
||||
|
||||
return OUT;
|
||||
}
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
//*****************************************************************************
|
||||
// Torque -- HLSL procedural shader
|
||||
//*****************************************************************************
|
||||
|
||||
// Dependencies:
|
||||
#include "core/rendering/shaders/torque.hlsl"
|
||||
|
||||
// Features:
|
||||
// Paraboloid Vert Transform
|
||||
// Visibility
|
||||
// Depth (Out)
|
||||
// Single Pass Paraboloid
|
||||
|
||||
struct VertData
|
||||
{
|
||||
float3 position : POSITION;
|
||||
float3 normal : NORMAL;
|
||||
float3 T : TANGENT;
|
||||
float3 B : BINORMAL;
|
||||
float2 texCoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
|
||||
struct ConnectData
|
||||
{
|
||||
float4 hpos : SV_Position;
|
||||
float isBack : TEXCOORD0;
|
||||
float2 posXY : TEXCOORD1;
|
||||
float depth : TEXCOORD2;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Main
|
||||
//-----------------------------------------------------------------------------
|
||||
ConnectData main( VertData IN,
|
||||
uniform float2 atlasScale : register(C4),
|
||||
uniform float4x4 worldViewOnly : register(C0),
|
||||
uniform float4 lightParams : register(C5)
|
||||
)
|
||||
{
|
||||
ConnectData OUT;
|
||||
|
||||
// Paraboloid Vert Transform
|
||||
OUT.hpos = mul(worldViewOnly, float4(IN.position.xyz,1)).xzyw;
|
||||
float L = length(OUT.hpos.xyz);
|
||||
bool isBack = OUT.hpos.z < 0.0;
|
||||
OUT.isBack = isBack ? -1.0 : 1.0;
|
||||
if ( isBack ) OUT.hpos.z = -OUT.hpos.z;
|
||||
OUT.hpos /= L;
|
||||
OUT.hpos.z = OUT.hpos.z + 1.0;
|
||||
OUT.hpos.xy /= OUT.hpos.z;
|
||||
OUT.hpos.z = L / lightParams.x;
|
||||
OUT.hpos.w = 1.0;
|
||||
OUT.posXY = OUT.hpos.xy;
|
||||
OUT.hpos.xy *= atlasScale.xy;
|
||||
OUT.hpos.x += isBack ? 0.5 : -0.5;
|
||||
|
||||
// Visibility
|
||||
|
||||
// Depth (Out)
|
||||
OUT.depth = OUT.hpos.z / OUT.hpos.w;
|
||||
|
||||
// Single Pass Paraboloid
|
||||
|
||||
return OUT;
|
||||
}
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
//*****************************************************************************
|
||||
// Torque -- HLSL procedural shader
|
||||
//*****************************************************************************
|
||||
|
||||
// Dependencies:
|
||||
#include "core/rendering/shaders/lighting.hlsl"
|
||||
//------------------------------------------------------------------------------
|
||||
// Autogenerated 'Light Buffer Conditioner [RGB]' Uncondition Method
|
||||
//------------------------------------------------------------------------------
|
||||
inline void autogenUncondition_bde4cbab(in float4 bufferSample, out float3 lightColor, out float NL_att, out float specular)
|
||||
{
|
||||
lightColor = bufferSample.rgb;
|
||||
NL_att = dot(bufferSample.rgb, float3(0.3576, 0.7152, 0.1192));
|
||||
specular = bufferSample.a;
|
||||
}
|
||||
|
||||
|
||||
#include "core/rendering/shaders/torque.hlsl"
|
||||
|
||||
// Features:
|
||||
// Vert Position
|
||||
// Detail
|
||||
// Diffuse Color
|
||||
// Deferred RT Lighting
|
||||
// Visibility
|
||||
// HDR Output
|
||||
|
||||
struct ConnectData
|
||||
{
|
||||
float4 vpos : SV_Position;
|
||||
float2 detCoord : TEXCOORD0;
|
||||
float4 screenspacePos : TEXCOORD1;
|
||||
};
|
||||
|
||||
|
||||
struct Fragout
|
||||
{
|
||||
float4 col : SV_Target0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Main
|
||||
//-----------------------------------------------------------------------------
|
||||
Fragout main( ConnectData IN,
|
||||
uniform SamplerState detailMap : register(S0),
|
||||
uniform Texture2D detailMapTex : register(T0),
|
||||
uniform float4 diffuseMaterialColor : register(C0),
|
||||
uniform float4 rtParamslightInfoBuffer : register(C2),
|
||||
uniform SamplerState lightInfoBuffer : register(S1),
|
||||
uniform Texture2D lightInfoBufferTex : register(T1),
|
||||
uniform float visibility : register(C1)
|
||||
)
|
||||
{
|
||||
Fragout OUT;
|
||||
|
||||
// Vert Position
|
||||
|
||||
// Detail
|
||||
OUT.col = ( detailMapTex.Sample(detailMap, IN.detCoord) * 2.0 ) - 1.0;
|
||||
|
||||
// Diffuse Color
|
||||
OUT.col = diffuseMaterialColor;
|
||||
|
||||
// Deferred RT Lighting
|
||||
float2 uvScene = IN.screenspacePos.xy / IN.screenspacePos.w;
|
||||
uvScene = ( uvScene + 1.0 ) / 2.0;
|
||||
uvScene.y = 1.0 - uvScene.y;
|
||||
uvScene = ( uvScene * rtParamslightInfoBuffer.zw ) + rtParamslightInfoBuffer.xy;
|
||||
float3 d_lightcolor;
|
||||
float d_NL_Att;
|
||||
float d_specular;
|
||||
lightinfoUncondition(lightInfoBufferTex.Sample(lightInfoBuffer, uvScene), d_lightcolor, d_NL_Att, d_specular);
|
||||
OUT.col *= float4(d_lightcolor, 1.0);
|
||||
|
||||
// Visibility
|
||||
fizzle( IN.vpos.xy, visibility );
|
||||
|
||||
// HDR Output
|
||||
OUT.col = hdrEncode( OUT.col );
|
||||
|
||||
|
||||
return OUT;
|
||||
}
|
||||
|
|
@ -1,73 +0,0 @@
|
|||
//*****************************************************************************
|
||||
// Torque -- HLSL procedural shader
|
||||
//*****************************************************************************
|
||||
|
||||
// Dependencies:
|
||||
#include "core/rendering/shaders/lighting.hlsl"
|
||||
//------------------------------------------------------------------------------
|
||||
// Autogenerated 'Light Buffer Conditioner [RGB]' Uncondition Method
|
||||
//------------------------------------------------------------------------------
|
||||
inline void autogenUncondition_bde4cbab(in float4 bufferSample, out float3 lightColor, out float NL_att, out float specular)
|
||||
{
|
||||
lightColor = bufferSample.rgb;
|
||||
NL_att = dot(bufferSample.rgb, float3(0.3576, 0.7152, 0.1192));
|
||||
specular = bufferSample.a;
|
||||
}
|
||||
|
||||
|
||||
#include "core/rendering/shaders/torque.hlsl"
|
||||
|
||||
// Features:
|
||||
// Vert Position
|
||||
// Detail
|
||||
// Diffuse Color
|
||||
// Deferred RT Lighting
|
||||
// Visibility
|
||||
// HDR Output
|
||||
|
||||
struct VertData
|
||||
{
|
||||
float3 position : POSITION;
|
||||
float3 normal : NORMAL;
|
||||
float3 T : TANGENT;
|
||||
float3 B : BINORMAL;
|
||||
float2 texCoord : TEXCOORD0;
|
||||
float2 texCoord2 : TEXCOORD1;
|
||||
};
|
||||
|
||||
|
||||
struct ConnectData
|
||||
{
|
||||
float4 hpos : SV_Position;
|
||||
float2 detCoord : TEXCOORD0;
|
||||
float4 screenspacePos : TEXCOORD1;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Main
|
||||
//-----------------------------------------------------------------------------
|
||||
ConnectData main( VertData IN,
|
||||
uniform float4x4 modelview : register(C0),
|
||||
uniform float2 detailScale : register(C4)
|
||||
)
|
||||
{
|
||||
ConnectData OUT;
|
||||
|
||||
// Vert Position
|
||||
OUT.hpos = mul(modelview, float4(IN.position.xyz,1));
|
||||
|
||||
// Detail
|
||||
OUT.detCoord = IN.texCoord * detailScale;
|
||||
|
||||
// Diffuse Color
|
||||
|
||||
// Deferred RT Lighting
|
||||
OUT.screenspacePos = OUT.hpos;
|
||||
|
||||
// Visibility
|
||||
|
||||
// HDR Output
|
||||
|
||||
return OUT;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue