Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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:
    467
    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