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

Revision 2024, 1.2 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, 1, 1);     
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 Plain(Plain_OUT IN) :COLOR0
45{
46 return IN.color;
47}
48
49float4 PlainTex2D(PlainTex_OUT IN,
50                uniform sampler2D Texture) : COLOR
51{
52 return IN.color * tex2D(Texture, IN.texCoord.xy);
53}
54
55float4 PlainTex1D(PlainTex_OUT IN,
56                  uniform sampler1D Texture) : COLOR
57{
58 return IN.color * tex1D(Texture, IN.texCoord.x);
59}
60
61float4 PlainTex3D(PlainTex_OUT IN,
62                  uniform sampler3D Texture) : COLOR
63{
64 return IN.color * tex3D(Texture, IN.texCoord.xyz);
65}
Note: See TracBrowser for help on using the repository browser.