mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-20 03:45:26 +00:00
73 lines
1.9 KiB
HLSL
73 lines
1.9 KiB
HLSL
//*****************************************************************************
|
|
// 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;
|
|
}
|