#2d water depth shader

1 messages · Page 1 of 1 (latest)

sinful olive
#

Hi! I'm trying to make a water shader that has foam/water depth when it comes near an island. Is there a way to do this in 2d with a shader graph?

weary root
#

So in 3D this is easily done by finding an intersection using the depth map. Unfortunately you don't really have that utility easily handed to you in 2D. So as an alternative you'll need to create your own texture that gives your shader the information of this intersection. Some ideas what this texture could be is a splatmap that marks the zones as terrain (red channel) and water (blue channel). You could also use multiple cameras to capture the terrain only which you can feed to your water shader as a render texture reference where you can compare pixel values for where it may intersect.