Platinguin / Godot-Water-Shader-Prototype

Water Shader Prototype for Godot
MIT License
322 stars 41 forks source link

How to get height information? #2

Closed D-Niermann closed 3 years ago

D-Niermann commented 3 years ago

Hi, very nice Shader you made there!

I want to use it in a sailing game and need the height information to calculate the correct height of the ship. I tried accessing the mesh vertices, but they seem to never change. Also calculating a collision mesh and scanning with raytracing did not work (the collision mesh is also never changing). So the only way would be to reproduce the vertex algorithm used by the GPU on the CPU?

D-Niermann commented 3 years ago

I got it to work out. Just read the image data with GDScript and synced the time by setting the time in GDScript and giving it to the shader every frame (dont use the Shader TIME variable)