How get Mesh height after shader deformation ?
Hi everybody,
I'm using shader graph to make an ocean. My shader modify vertices height to make waves.
Now I wanna create floating object wich react to waves. I don't want to use a collider on my ocean for performance. But I need to get height of my mesh at some points...
Do you know how can I get it from my shader or from a script ? Does existing a sort of ray casting for non-collider object ? Thank you for all =)
Answer by vampir26 · Aug 06, 2020 at 03:47 PM
You can't "get" the height. You need to mirror the "wave generation" function from your shader in a c# script and create a function to recalculate the wave parallel at your desired position to get the height.
Your answer
Follow this Question
Related Questions
strange grass and soft partcile glitch, example image attached. 0 Answers
Custom Grass/Wind/Winzone/shader 0 Answers
Mesh is lit through the terrain? 0 Answers
Water camera effects 0 Answers