source: trunk/VUT/GtpVisibilityPreprocessor/src/dual_depth.cg @ 532

Revision 532, 527 bytes checked in by mattausch, 18 years ago (diff)
Line 
1struct fragment
2{
3        float4 position  : POSITION;    //screen position
4        float4 color0    : COLOR0;
5        float4 depthTexCoord: TEXCOORD0;
6};
7
8
9struct pixel
10{
11        float4 color : COLOR;   
12};
13
14pixel main(fragment IN, const uniform sampler2D depthMap)
15{
16        pixel OUT;
17
18        // the depth buffer     has to be compared to the current depth
19        float4 depth = tex2D(depthMap, IN.depthTexCoord.xy);
20        float test = IN.depthTexCoord.z / IN.depthTexCoord.w;
21       
22        // reject by alpha test
23        if (test < depth.x)
24                OUT.color.w = 0;
25
26        return OUT;
27}
Note: See TracBrowser for help on using the repository browser.