- Home /
Water foam shader that works on planet water
Hello everyone. I've been lately trying to make a procedural planet generator for an RTS mobile game. I've finally started work on the water that will fill the planet, and I wanted to have foam form on the shores. I've tried several foam techniques, and all use scene depth to get the foam to only show on the shore. Here's an example of what I would like to achieve (notice the foam on the lakes' borders)
I've experimented with Brackeys' force field shader (https://www.youtube.com/watch?v=NiOGWZXBg4Y&t=860s&ab_channel=Brackeys), but I only get a white circle on the center of the view instead of getting foam on the borders of the water mesh that collide with the planet.
Is there a good way to get the above result with shader graph and URP?
Thank you in advance.
Edit: I'm using Sebastian Lague's tutorials to create a cube sphere for the planet terrain, and I'm creating a second cube sphere for the water sphere.
Answer by julianhahn01 · Jan 10, 2021 at 08:45 AM
Hi, I tried this once and than realised, that i can not use the depth node with my vr app, so no guarantees. In this tutorial they explain "okay-isch" which shade you need to get a propper blend effect. https://www.youtube.com/watch?v=gRq-IdShxpU
I've tried using the depth node and it doesn't work. I know I have configured everything currectly by enabling depth textures, etc. However, it only gives a slight color variation in the center of the camera, but not on the shore.