solve for floating object on waves created with shaders.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Joshua Blackmon

This has been answered for unity , but I was attempting do this in Godot. I made a big ocean . I have used multiple nodes, methods and still have no answer , and perhaps won’t have an answer other than manually making times for an object that can’t detect a wave. I simply would like to have an object that could detect a material wave… but granted I have taken multiple avenues… IE , I used camera to get the color/non color of the ocean i want it to detect and try and base buoyancy on true/false… , but I cannot get the color from the viewport texture, the wave itself has 0 collision , and i doubt i can get any vector data from it… if so overwhelming. I’ve attempted color picker… to pick the viewport texture automatically off to the side… to get a color for yes no, up or down for a boat, to be honest… I’m stumped… on this one. there’s a visibility notifier,. but it only works for the main view port. if there is anyway at all to create false buoyancy for waves… in Godot. I just need to get a single color for yes /no or a way to detect a material , or a way to get the data from it to create false buoyancy … otherwise… im going to spend allot of trial and error … making a boat work on an ocean that follows player unfortunately .

:bust_in_silhouette: Reply From: Inces

To be honest I didn’t think problem like this could be solved in any other engine, shaders typically can’t return any feedback. What I would do is calculate a real wave in code, pass it to shader as uniform to make visual waves, and pass it to object, to determine its floating behavior.