/* sampler ImpostorMap; float4 main(float3 lightVec: TEXCOORD0, float3 texCoord: TEXCOORD1) : COLOR { // Output radial distance float alpha = tex2D(ImpostorMap, texCoord).z; float depth; depth = length(lightVec); //return length(lightVec); return float4(depth,depth,depth,alpha); } */ float4 main( float4 lightvec: TEXCOORD2, float3 texCoord: TEXCOORD0, float3 texCoordNormalized: TEXCOORD1, float4 color: COLOR0, uniform float nearDistance, uniform float farDistance, uniform sampler2D orderFrontBack, uniform sampler2D leaf): COLOR { // Output radial distance float depth; depth = length(lightvec.xyz); float4 tempcolor; //tempcolor = float4(depth,depth,depth,tex2D(orderFrontBack,texCoord).w); tempcolor = (tex2D(orderFrontBack, texCoord).x >= 0.0) ? tex2D(leaf,((texCoordNormalized - tex2D(orderFrontBack, texCoord).xy) + tex2D(orderFrontBack, texCoord).zw) * 64.0) : 0.0; tempcolor = (tempcolor.w > 0.0) ? float4(depth,depth,depth,tempcolor.w) : 0.0; float4 ocolor; //ocolor = tempcolor; ocolor = color; return ocolor; //float value = (tempcolor.w > 0.0) ? depth : 0.0; //return value; }