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

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