historical/toontown-classic.git/panda/samples/shadows/caster.sha
2024-01-16 11:20:27 -06:00

20 lines
512 B
Text

//Cg
void vshader(float4 vtx_position : POSITION,
uniform float4x4 mat_modelproj,
uniform float4 k_scale,
out float4 l_position : POSITION,
out float4 l_pos : TEXCOORD0
)
{
float4 position = vtx_position * k_scale;
l_pos = mul(mat_modelproj, position);
l_position = l_pos;
}
void fshader(in float4 l_pos : TEXCOORD0,
out float4 o_color : COLOR)
{
float z = (l_pos.z / l_pos.w) * 0.5 + 0.5;
o_color = float4(z, z, z, 1);
}