How to generate the depth of the screen

How to generate the depth of the screen

Can provide similar examples of special effects ?

Aras , very thank reply

Do you provide sample files?

check the replacement shaders examples in unity site. There is the example of custom depth generation.

Aubergine , thank you reply

I will RenderDepth on Camera no effect, this is what happened, tell me explain. :face_with_spiral_eyes:

1051800--39063--$0000.jpg

If you check the renderdepth.cs file, it actually writes to a render texture. Obviously you wont see it on screen if you wont use it somehow.

Just put this one line of code inside the bottom of function OnPostRender() from RenderDepth.js script (from ShaderReplacement Project):

function OnPostRender()
{
	//........

	// Display on Screen
	Graphics.Blit (renderTexture, null);
}

Main Camera should Render the “Depth Texture” on Screen

I wrote a C sharp version and Added the Invert Image function,also attached the Depth shader here as well:

1075961–40183–$RenderDepthOnScreen.cs (2.35 KB)
1075961–40184–$RenderDepth.shader (559 Bytes)