How to use Scene Depth to show items behind object?

I’m making a slime shader and I want to get depth involved like in these images:


b195d0af819d025c9d7cef9fdae7a40c.jpg

I think the scene depth node might be the key, but the documentation only shows how to lerp between colours, not the object itself:


Is there a way to show the objects behind the surface, with the scene depth being more of an overlay?

Also I need it to measure the depth from the surface to the object, rather than from the camera. Is there a way to use scene depth in this way, or a different solution?

Use difference between current PixelDepth and SceneDepth.

Keep in mind that you need to use Translucent Materials. Else you wouldn’t be able to see Depth behind the Slime.
A mixture of Translucent and Subsurface Scattering should do the trick.

GOO DOh ! - YouTube is this something you might be interested in?

I set up this translucent material with default lit shading, but subsurface indeed ads a little more gradients to the surface since it is “emiting” the same color content. One thing that gave me some troubles was the triangles of the uneven blobby objects (eg the rock) the tris always were appeared in front of, while they should have been culled. Translucent projection does not support the proper sorting for the triangles, so you have to take care of those by using the depth culling technique described in Tom Looman’s article . It will require to render the content in the custom depth channel as well to have a proper depth information available for the culling.

After that this is a piece of gooo!

Wonderfully helpful thanks guys! Konflict that slime shader is brilliant, exactly the kind of thing we’re going for. Did you ever use it in a final project? Thanks for the info you’ve given me a great starting point, really appreciated.