Pixel Depth for Non-transparent Materials

Is it possible to have the same effect of depth fade working for a non-translucent object? I have rocks that I want to change material once they penetrate my landscape.

Thanks guys.

Use a lerp?

Thank for the reply, . A lerp would work if my material were set to translucent. However, I’m wanting to know if there is a workaround way to do it without having to set my material to translucent. Here’s my problem perhaps explained better:

Below is what occurs when I set the material to translucent (seemingly required in order to use a depth fade). Objects don’t properly order themselves. It’s always one object entirely in front of the other, never penetrating as they would with non-translucent materials assigned to them (these two rocks are penetrating, but don’t show it.).

So naturally I turn off translucency, however the editor doesn’t like that:

Is there a work around for this so that I can use depth fade without having to set my material to translucent, or atleast a fix to the sorting issue while translucency is enabled? Thanks again guys :slight_smile:

Custom depth translucent material could be a solution, but i’m afraid the performance is really bad.

I guess even if you are using custom depth to solve sorting problem, you will get some new problems.
The translucent material is enable depth test, so when you look at the translucent fade part from the front rock, you can’t see the opaque part from the back rock, because it has been clipped by depth test.

1 Like

Fake it by using a second mesh that are a little bigger around it with a translucent material with depth fade :slight_smile: or something.

hey thanks Numbat and raydEx for the ideas! I’ll give those things a go :slight_smile: