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

Revision 2312, 1.7 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
26struct LightVPos_OUT
27{
28 float4 VPos : POSITION;
29 float4 LightVPos : TEXCOORD0;
30};
31
32
33
34float4 VDepth(VPos_OUT IN) : COLOR
35{
36 float4 pos = IN.VPosition / IN.VPosition.w;
37 return float4(pos.z, 0, 0, 1);
38}
39
40float4 CDepth(CPos_OUT IN,
41                                uniform float farplane) : COLOR
42{
43 return float4(-IN.CPos.z, -IN.CPos.z / farplane, 0, -IN.CPos.z);       
44}
45
46float4 CDist(CPos_OUT IN) : COLOR
47{
48 float dist = length(IN.CPos.xyz);
49 return float4(dist, dist * dist, 1, dist);     
50}
51
52float4 CDistNorm(CPos_OUT IN,
53                                uniform float farPlane) : COLOR
54{
55 float dist = length(IN.CPos.xyz) / farPlane;
56 return float4(dist, dist * dist, 1, dist);     
57}
58
59float4 Plain(Plain_OUT IN) :COLOR0
60{
61 return IN.color;
62}
63
64float4 PlainTex2D(PlainTex_OUT IN,
65                                  uniform sampler2D Texture) : COLOR
66{
67 return tex2D(Texture, IN.texCoord.xy);
68}
69
70float4 PlainTex2DColored(PlainTex_OUT IN,
71                                        uniform float4 color,
72                                  uniform sampler2D Texture) : COLOR
73{
74 return color * tex2D(Texture, IN.texCoord.xy);
75}
76
77float4 PlainTex1D(PlainTex_OUT IN,
78                  uniform sampler1D Texture) : COLOR
79{
80 return IN.color * tex1D(Texture, IN.texCoord.x);
81}
82
83float4 PlainTex3D(PlainTex_OUT IN,
84                  uniform sampler3D Texture) : COLOR
85{
86 return IN.color * tex3D(Texture, IN.texCoord.xyz);
87}
88
89float4 LightVPosPS(LightVPos_OUT IN):COLOR
90{
91 return float4(IN.LightVPos.xyz / IN.LightVPos.w, 1);
92}
Note: See TracBrowser for help on using the repository browser.