About Node Material Questions

I’m trying to use node material to make water shader. At present, there are some requirements that I can’t do. At present, I can’t use the XZ direction of world space to build the disturbance of water pattern. Can Babylon join the depth node?

Welcome aboard!

What do you mean by “depth node”? Do you want to be able to sample from the depth buffer that would be generated by the depth renderer?

Nice looking water by the way!

Thank you for your answers and praise. My consciousness is to do water display different colors in different depth and shallow areas through depth detection, but I don’t see the NME nodes on depth detection. So ask, or is there any other way to realize different water color requirements in different depths?

PR is on its way:

Once it is merged, you will have access to a new SceneDepth block that will let you access the scene depth buffer.

As an example, I reused the great ocean shader and modified it to take into account the scene depth buffer:
https://playground.babylonjs.com/#9B0DNU#58
(will only work when the PR is merged)

2 Likes

This is awesome! This opens up the possibility for some cool volumetric and other type effects in NME.

1 Like