home *** CD-ROM | disk | FTP | other *** search
- //simple shader to clip any pixels with a Z coordinate below the water plane
- //does not apply lights
- //applies vertex diffuse colors and texture sampling
- //clips anything below a specified z
- //must be used with clipZ2_ps1.vsh
- //Luke Lenhart
- //(C)2004-2005 Digipen Institute of Technology
-
- //base texture
- sampler2D sampTex;
-
- //shader input
- struct PS_INPUT
- {
- float PosZ : TEXCOORD1;
- float2 Tex0 : TEXCOORD0;
- float4 Clr : COLOR0;
- };
-
- //shader
- float4 PShader(PS_INPUT In) : COLOR
- {
- if (In.PosZ<0.5f) In.Clr.a=0;
- return In.Clr*tex2D(sampTex,In.Tex0);
- };
-