(foreword: I just finished a minor surgery and am pumped on drugs. Pls forgive me if I am not fully coherent)
What I’m trying to do: port a stylized water shader to bjs (ref: https://www.reddit.com/r/Unity3D/comments/f6bh50/making_stylized_water_with_shader_graph/)
Todo list:
- depth to color control (completed: Babylon.js Playground)
- Transparency control
- UV distortion control
- foam control
As you can see from the PG, I have a simple bathtub setup and the water color control to depth working. But the water mesh isn’t showing the texture of the objects behind it. To do so, I have to pass the current framebuffer to the shader and mix the result with the water color params. I have trouble passing the framebuffer texture to the shaderMaterial.
The post process route does not accommodate vertex shader which I have. If I uncomment lines 114 & 141, I get the depth map showing up on my water mesh indicating the framebuffer texture not going thru. If I rty to load it thru shaderMaterial.setTexture
, console throws TypeError: this._textures[A].isReady is not a function
How can I check the ready state of the texture before passing into the shader?