Hi, we are trying to use Rendering with Shader Replacement, depth script and shader. However we having trouble with inversing the texture the depth produces.
We need the black to be the far ground and white to be near ground.
Any ideas on how to invert this texture?
Thanks.
Lloyd. 
You could probably use the render to texture color correction feature for that. Check out this page of the docs:
http://unity3d.com/support/documentation/Components/script-GrayscaleEffect.html
Mark
That’s a post-processing feature, which isn’t very useful in this case. How about, in whatever shader you’re using, instead of just using the value, use 1-value? That would give you the inverse.
–Eric
Thanks for the replies, however we have tried the 1-value but we don’t know where to put in the Depth shader. If you could give us a hint that would be great.
Thanks.
Lloyd.
This is the shader that were using. If anyone could point me in the right direction ot have black at the back and white at the front.
Shader "Hidden/Render Depth" {
SubShader {
Tags { "RenderType"="Opaque" }
Pass {
Fog { Mode Off }
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct v2f {
float4 pos : POSITION;
float depth : TEXCOORD0;
};
v2f vert( appdata_base v ) {
v2f o;
o.pos = mul(glstate.matrix.mvp, v.vertex);
TRANSFER_EYEDEPTH(o.depth);
return o;
}
half4 frag(v2f i) : COLOR {
OUTPUT_EYEDEPTH(i.depth);
}
ENDCG
}
}
Fallback Off
}
Lloyd