Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Question How should we create water and wave?

Discussion in 'Physics' started by Milky066, Aug 10, 2020.

  1. Milky066

    Milky066

    Joined:
    Mar 23, 2020
    Posts:
    1
    I'm looking for ideas to generate a water plane with waves that allows objects to float and react to the waves. I had one in mind which is manipulating the mesh vertices using scripts but the CPU's not really effective when it needs to move a lot of vertices. I'm thinking about using Shader to manipulate the vertices, but dead-end here. Any advice?
     
  2. tjmaul

    tjmaul

    Joined:
    Aug 29, 2018
    Posts:
    470
    Why is moving the vertices with a shader a dead end? That’s actually a perfect example for the application of vertex shaders.

    a tutorial to get you started was released by unity a month ago: https://youtu.be/gRq-IdShxpU

    F
    or buoyancy (also, lots of good tutorials), just use the same equations for the water displacement as you used in the shader and you have the same data in CPU-land.
     
  3. SparrowGS

    SparrowGS

    Joined:
    Apr 6, 2017
    Posts:
    2,536