source: GTP/trunk/App/Demos/Illum/pathmap/normalize.fx @ 2197

Revision 2197, 1.1 KB checked in by szirmay, 17 years ago (diff)
Line 
1texture atlas;
2sampler atlasSampler = sampler_state
3{
4   Texture = <atlas>;
5   MinFilter = Point;
6   MagFilter = Point;
7   MipFilter = None;
8   AddressU = Wrap;
9   AddressV = Wrap;
10};
11
12struct vsInputNormalizePRM
13{
14    float4      pos                     : POSITION;
15    float2      tex                     : TEXCOORD0;
16};
17
18struct vsOutputNormalizePRM
19{
20    float4      pos                     : POSITION;
21    float2      tex                     : TEXCOORD0;
22};
23
24vsOutputNormalizePRM
25        vsNormalizePRM(vsInputNormalizePRM input)
26{
27    vsOutputNormalizePRM output = (vsOutputNormalizePRM)0;
28    output.pos = input.pos;
29    output.tex = input.tex;
30    return output;
31}
32
33float4
34        psNormalizePRM(vsOutputNormalizePRM input) : COLOR0
35{
36//      float4 unn = tex2D(atlasSampler, input.tex + float2(0.5 / 4096.0, 0.5 / 128.0));
37        float4 unn = tex2D(atlasSampler, input.tex);
38//      if(unn.a < 1.0 / 4096.0)
39//              unn = float4(0, 0, 0, 1);
40//      return unn;
41        return float4(unn.rgb * (4096.0 / unn.a), 1);
42}
43
44
45technique NormalizePRM{
46        pass P0
47    {
48        VertexShader = compile vs_3_0 vsNormalizePRM();
49        PixelShader  = compile ps_3_0 psNormalizePRM();
50    }
51}
52
Note: See TracBrowser for help on using the repository browser.