0
\$\begingroup\$

I am making waterwaves in shadergraph and i want to make a boat that will bop around on those waves, but to do that i need to get those vertices back into the CPU. I am unable to replicate those waves in the CPU as it is not based on world position in the shader.

Is there a way of getting the vertices back from the shader or is making the waves based on world position my only option. Also because i do not know where the time node gets its value. I figure that it is better to get the vertices back to the CPU than replicating it so that i do not have to change the code on both sides when changing something. The mesh with waves is quite small.

If there is a better method to do this, that would be greatly appreciated. I do not have a lot of experience in Unity.

\$\endgroup\$
2
  • \$\begingroup\$ I'm not sure if there is transform feedback in Unity, but that's what you're looking for. \$\endgroup\$ Commented Dec 4, 2022 at 20:51
  • \$\begingroup\$ What are the waves based on, if not world position or some other quantity predictable from the CPU? Keep in mind that the bandwidth between CPU and GPU is one of your most strictly limited resources - reading data back from the GPU is very expensive compared to just calculating it CPU-side. \$\endgroup\$
    – DMGregory
    Commented Dec 4, 2022 at 22:17

0

You must log in to answer this question.