Line | |
---|
1 | struct 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 |
|
---|
12 | VertexOut 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 |
|
---|
28 | void 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.