source: GTP/trunk/App/Demos/Illum/Ogre/Media/materials/GTPBasic/GTPBasic_PS.hlsl @ 2179

Revision 2179, 1.3 KB checked in by szirmay, 17 years ago (diff)
Line 
1struct Plain_OUT
2{
3 float4 vPos : POSITION;
4 float4 color :COLOR0;
5};
6
7struct PlainTex_OUT
8{
9 float4 vPos : POSITION;
10 float4 color :COLOR0;
11 float4 texCoord: TEXCOORD0;
12};
13
14struct VPos_OUT
15{
16 float4 VPos : POSITION;
17 float4 VPosition : TEXCOORD0;
18};
19
20struct CPos_OUT
21{
22 float4 VPos : POSITION;
23 float4 CPos : TEXCOORD0;
24};
25
26
27float4 VDepth(VPos_OUT IN) : COLOR
28{
29 float4 pos = IN.VPosition / IN.VPosition.w;
30 return float4(pos.z, pos.z * pos.z, 0, pos.z);
31}
32
33float4 CDepth(CPos_OUT IN) : COLOR
34{
35 return IN.CPos.z;     
36}
37
38float4 CDist(CPos_OUT IN) : COLOR
39{
40 float dist = length(IN.CPos.xyz);
41 return float4(dist, dist * dist, 1, dist);     
42}
43
44float4 CDistNorm(CPos_OUT IN,
45                                uniform float farPlane) : COLOR
46{
47 float dist = length(IN.CPos.xyz) / farPlane;
48 return float4(dist, dist * dist, 1, dist);     
49}
50
51float4 Plain(Plain_OUT IN) :COLOR0
52{
53 return IN.color;
54}
55
56float4 PlainTex2D(PlainTex_OUT IN,
57                uniform sampler2D Texture) : COLOR
58{
59 return IN.color * tex2D(Texture, IN.texCoord.xy);
60}
61
62float4 PlainTex1D(PlainTex_OUT IN,
63                  uniform sampler1D Texture) : COLOR
64{
65 return IN.color * tex1D(Texture, IN.texCoord.x);
66}
67
68float4 PlainTex3D(PlainTex_OUT IN,
69                  uniform sampler3D Texture) : COLOR
70{
71 return IN.color * tex3D(Texture, IN.texCoord.xyz);
72}
Note: See TracBrowser for help on using the repository browser.