Poodletooth-iLand/build/nirai/panda3d/samples/shadows/caster.sha

21 lines
512 B
Text
Raw Normal View History

2015-11-14 13:28:53 -06:00
//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);
}