source: GTP/branches/IllumWPdeliver2008dec/IlluminationWP/demos/OgreGames/SpaceStation/Media/GTPBasic/GTPBasic_PS.hlsl @ 3255

Revision 3255, 1.8 KB checked in by szirmay, 15 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(0.5,0,0,0);
44 return float4(-IN.CPos.z, -IN.CPos.z / farplane, 0, -IN.CPos.z);       
45}
46
47float4 CDist(CPos_OUT IN) : COLOR
48{
49 float dist = length(IN.CPos.xyz);
50 return float4(dist, dist * dist, 1, dist);     
51}
52
53float4 CDistNorm(CPos_OUT IN,
54                                uniform float farPlane) : COLOR
55{
56 float dist = length(IN.CPos.xyz) / farPlane;
57 return float4(dist, dist * dist, 1, dist);     
58}
59
60float4 Plain(Plain_OUT IN) :COLOR0
61{
62 return IN.color;
63}
64
65float4 PlainTex2D(PlainTex_OUT IN,
66                                  uniform sampler2D Texture) : COLOR
67{
68 return tex2D(Texture, IN.texCoord.xy);
69}
70
71float4 PlainTex2DColored(PlainTex_OUT IN,
72                                        uniform float4 color,
73                                  uniform sampler2D Texture) : COLOR
74{
75 return color * tex2D(Texture, IN.texCoord.xy);
76}
77
78float4 PlainTex1D(PlainTex_OUT IN,
79                  uniform sampler1D Texture) : COLOR
80{
81 return IN.color * tex1D(Texture, IN.texCoord.x);
82}
83
84float4 PlainTex3D(PlainTex_OUT IN,
85                  uniform sampler3D Texture) : COLOR
86{
87 return IN.color * tex3D(Texture, IN.texCoord.xyz);
88}
89
90float4 LightVPosPS(LightVPos_OUT IN):COLOR
91{
92 return float4(IN.LightVPos.xyz / IN.LightVPos.w, 1);
93}
Note: See TracBrowser for help on using the repository browser.