source: GTP/trunk/App/Demos/Illum/Illumination Networks Demo [OpenGL]/src/LVisDisplay.cg @ 845

Revision 845, 1.0 KB checked in by szirmay, 18 years ago (diff)
Line 
1struct VertexOut
2{
3        float4 Position                         :POSITION;
4        float2 TexCoord                         :TEXCOORD0;
5        float ID                                        :TEXCOORD2;
6        float4 Depth                            :TEXCOORD1;
7        float PSize                                     :PSIZE;
8               
9};
10
11
12VertexOut VertexProgram(
13                  float4 Position   : POSITION,
14          float2 TexCoord : TEXCOORD0,
15          float4 Color : COLOR0,         
16          uniform float4 PSize : state.point.size,
17                  uniform float4x4 modelViewProj:state.matrix.mvp
18          )
19{
20        VertexOut Out;
21        Out.ID=TexCoord.x;
22    Out.PSize =PSize.x*TexCoord.y;     
23        Out.Position = mul(modelViewProj, Position);
24 //   Out.Depth=Out.Position.z/2+0.5;
25    return Out;
26}
27
28void FragmentProgram(           VertexOut In,
29                                                uniform sampler2D BbTexture,
30                                                out float4 Color: COLOR//,
31                                                //out float Depth:DEPTH
32                                                )
33{       
34        int intensity=round(In.ID);
35        if(intensity<0)intensity=0;
36       
37        float thecolor=intensity;
38        Color=float4(thecolor,thecolor,thecolor,tex2D(BbTexture,In.TexCoord).r);
39       
40        /*
41        if(tex2D(BbTexture,In.TexCoord).r==0)
42        {
43                Depth=1;
44        }
45        else
46        {
47                Depth=In.Depth;
48        }
49        */
50}
Note: See TracBrowser for help on using the repository browser.