Poodletooth-iLand/build/nirai/panda3d/samples/shadows/caster.sha
2015-11-14 14:28:53 -05: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);
}