Jump to content
  • Advertisement
Sign in to follow this  

Gameplay Creating 3D water on Unity for iOS/Android

Recommended Posts

I want to render an ocean where players can change waves’ amplitude in real-time. Initially, I would render rolling waves (see picture). As the amplitude increases, I need to transition the rolling waves into breaking waves (see picture). For now, I am not going to show the shoreline onscreen so I don’t need to render breaking waves interacting with the shoreline; I only need breaking waves on the open ocean.

I’ve tried three different approaches so far and I’ve only had success with rolling waves using approach 1. Breaking waves have been impossible so far with all three approaches.

Approach 1: Mesh deformation

a.     I can create smooth rolling waves using the Sine and Gerstner equations.

b.     Since I can’t use these equations for breaking waves, I tried to implement them by using this free plugin whose output is similar to this paid mesh deformation plugin. But there are 2 problems with this plugin approach:

·      There is no smooth transition between rolling waves generated by approach 1a and the breaking waves generated by the Deform plugin

·      The output of the plugin does not look similar to real breaking ocean waves in three different ways:

                                               i.     No smooth blending with the ocean surface

                                              ii.     A large depression is created below the crest

                                            iii.     The entire wave is the same height (rather than with more realistic variations)

c.      I considered using vertex shaders but this approach seems similar to mesh deformation.

Approach 2: Fluid dynamics + metaballs

1.     To render an ocean I will need thousands of particles which will be too expensive in terms of performance (especially for mobile devices).

Approach 3: Using mesh files

1.     I can create breaking waves using some 3D software like in this post but then I can’t modify the ocean in real-time. It will be more like a pre-rendered simulation.

To summarize, I am looking for an approach where I can vary ocean waves’ amplitude for a smooth transition between rolling waves and breaking waves. Please let me know if you have more questions.

Share this post

Link to post
Share on other sites

Things you start out with:

  1. define, what perspective the player can have. If the player only ever sees the sea from top down, you can keep the "3D" much more simple. A flat angle (being close to the ground) requires you to have actual 3D models, but the player could only see the first few waves.
  2. define the distance from the water. Again, the further the player (/the camera) is away from the water, the simpler this can be done. If he's far enough, there would only be little difference between 3D and just textures. Being a bit closer, you could have simple 3D geometry and add the details using textures.
  3. define the art style. The more it leans to realistic, the more detailed everything has to be
  4. Will these waves be "animated", or will you just render a single point in time?

Keep in mind: you're trying to do this for mobile. If you're really only interested in drawing waves and no other gameplay content, then it might not be as much of a problem, but if you want/have to stick to a certain hardware limitation, you should think about the things listed above, since all of them influence the performance.

Share this post

Link to post
Share on other sites

Thank you for your reply. Below is further information matching your points.

  1. The camera perspective will be similar to this image.
  2. The required view of the breaking wave is similar to this image.
  3. I am trying to implement the toony art style as shown here (see video).
  4. Yes, the waves will continuously animate.

There will be other gameplay elements such as surfers and hence I am looking for a mobile-friendly solution.

Share this post

Link to post
Share on other sites

Thank you for your reply. I have tried the approach mentioned in the "particle in a circular motion" approach but the output doesn't look like the target output.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!