1 | struct Plain_OUT
|
---|
2 | {
|
---|
3 | float4 vPos : POSITION;
|
---|
4 | float4 color :COLOR0;
|
---|
5 | };
|
---|
6 |
|
---|
7 | struct PlainTex_OUT
|
---|
8 | {
|
---|
9 | float4 vPos : POSITION;
|
---|
10 | float4 color :COLOR0;
|
---|
11 | float4 texCoord: TEXCOORD0;
|
---|
12 | };
|
---|
13 |
|
---|
14 | struct VPos_OUT
|
---|
15 | {
|
---|
16 | float4 VPos : POSITION;
|
---|
17 | float4 VPosition : TEXCOORD0;
|
---|
18 | };
|
---|
19 |
|
---|
20 | struct CPos_OUT
|
---|
21 | {
|
---|
22 | float4 VPos : POSITION;
|
---|
23 | float4 CPos : TEXCOORD0;
|
---|
24 | };
|
---|
25 |
|
---|
26 |
|
---|
27 | float4 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 |
|
---|
33 | float4 CDepth(CPos_OUT IN) : COLOR
|
---|
34 | {
|
---|
35 | return -IN.CPos.z;
|
---|
36 | }
|
---|
37 |
|
---|
38 | float4 CDist(CPos_OUT IN) : COLOR
|
---|
39 | {
|
---|
40 | float dist = length(IN.CPos.xyz);
|
---|
41 | return float4(dist, dist * dist, 1, dist);
|
---|
42 | }
|
---|
43 |
|
---|
44 | float4 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 |
|
---|
51 | float4 Plain(Plain_OUT IN) :COLOR0
|
---|
52 | {
|
---|
53 | return IN.color;
|
---|
54 | }
|
---|
55 |
|
---|
56 | float4 PlainTex2D(PlainTex_OUT IN,
|
---|
57 | uniform sampler2D Texture) : COLOR
|
---|
58 | {
|
---|
59 | return IN.color * tex2D(Texture, IN.texCoord.xy);
|
---|
60 | }
|
---|
61 |
|
---|
62 | float4 PlainTex1D(PlainTex_OUT IN,
|
---|
63 | uniform sampler1D Texture) : COLOR
|
---|
64 | {
|
---|
65 | return IN.color * tex1D(Texture, IN.texCoord.x);
|
---|
66 | }
|
---|
67 |
|
---|
68 | float4 PlainTex3D(PlainTex_OUT IN,
|
---|
69 | uniform sampler3D Texture) : COLOR
|
---|
70 | {
|
---|
71 | return IN.color * tex3D(Texture, IN.texCoord.xyz);
|
---|
72 | }
|
---|