1 | /*
|
---|
2 | sampler ImpostorMap;
|
---|
3 | float4 main(float3 lightVec: TEXCOORD0, float3 texCoord: TEXCOORD1) : COLOR {
|
---|
4 | // Output radial distance
|
---|
5 | float alpha = tex2D(ImpostorMap, texCoord).z;
|
---|
6 |
|
---|
7 | float depth;
|
---|
8 | depth = length(lightVec);
|
---|
9 | //return length(lightVec);
|
---|
10 | return float4(depth,depth,depth,alpha);
|
---|
11 | }
|
---|
12 | */
|
---|
13 |
|
---|
14 | float4 main(
|
---|
15 | float4 lightvec: TEXCOORD2,
|
---|
16 | float3 texCoord: TEXCOORD0,
|
---|
17 | float3 texCoordNormalized: TEXCOORD1,
|
---|
18 | float4 color: COLOR0,
|
---|
19 | uniform float nearDistance,
|
---|
20 | uniform float farDistance,
|
---|
21 | uniform sampler2D orderFrontBack,
|
---|
22 | uniform sampler2D leaf): COLOR
|
---|
23 | {
|
---|
24 | // Output radial distance
|
---|
25 | float depth;
|
---|
26 | depth = length(lightvec.xyz);
|
---|
27 |
|
---|
28 | float4 tempcolor;
|
---|
29 | //tempcolor = float4(depth,depth,depth,tex2D(orderFrontBack,texCoord).w);
|
---|
30 | tempcolor = (tex2D(orderFrontBack, texCoord).x >= 0.0) ? tex2D(leaf,((texCoordNormalized - tex2D(orderFrontBack, texCoord).xy) + tex2D(orderFrontBack, texCoord).zw) * 64.0) : 0.0;
|
---|
31 | tempcolor = (tempcolor.w > 0.0) ? float4(depth,depth,depth,tempcolor.w) : 0.0;
|
---|
32 |
|
---|
33 | float4 ocolor;
|
---|
34 | //ocolor = tempcolor;
|
---|
35 | ocolor = color;
|
---|
36 |
|
---|
37 | return ocolor;
|
---|
38 |
|
---|
39 | //float value = (tempcolor.w > 0.0) ? depth : 0.0;
|
---|
40 | //return value;
|
---|
41 | }
|
---|
42 |
|
---|