Depth Texture hates me - Bad Precision with Replaced Shader Rendering

Hello guys, hello girls! :smile:

I have a problem with my depth texture while rendering with replaced shaders. The quality of the resulting depth texture is bad, what means that I have “stripes” in the texture instead of smooth values.

In my code I do this:

RenderTexture depthMap = new RenderTexture(bufferSize, bufferSize, 32, RenderTextureFormat.ARGB32);

//[...]

Cam.targetTexture = depthMap;
Cam.RenderWithShader(Shader.Find("Hidden/Camera-DepthTexture"), null);

Although the color depth is set to 32 bit, the precision stays low. (At least when I draw the texture in the GUI)

But I need high precision because I pass the texture to another shader to work with it.

How can I fix it? Would be great if someone knew something !! :smile: :slight_smile:

valle

Noone? :confused: I need this for my thesis so I would be very thankful if someone would have a little hint! :slight_smile:

The ARGBFloat did the trick!

new RenderTexture(bufferSize, bufferSize, 24, RenderTextureFormat.ARGBFloat);

thanks anyway! :slight_smile: