Assets Water system based on baked fluid simulation

Hello, recently I've been working on a water system for rendering fluid simulation in Unity. Currently, work is under way to simulate and render the ocean near the coastline. The fluid simulation itself is performed using the particle-in-cell method, then this module uses the saved data (fluid surface and particles) for rendering.

The video below shows a simple example of simulating the surf zone (5 second loop). For better quality watch in 4k.

There are obvious flaws in the video (development is in progress), but it gives the general idea.

It is planned that this module will require about 512 MB of video memory. For each type of shoreline, 50-200 MB of disk space is required. If there are 20 different types of shoreline in a game, it will require 1-4 GB of disk space depending on the complexity of the flow.

Now, work is underway to create a library of different types of shoreline, combining which (manually or procedurally) the game level is created. By type of shore is meant a geometry that affects the behavior of the fluid near the shoreline. Color, texture, the presence of additional objects, whose difference in geometry does not affect the flow, can be arbitrary.

The shoreline will be constructed in two stages:
1. Drawing a spline;
2. Filling the shoreline with different types of shore along the spline (for example sandy beach, rock, pier, shipwreck, seawall, …).

Recently I've been working on an asset for rendering fluid simulation in Unity. The fluid simulation itself is performed using the particle-in-cell method, then this asset uses the saved data (fluid surface and particles) for rendering.

Currently, the asset gives 60 fps on NVIDIA GeForce GTX 960, but there is much room for optimization.
The video below shows a simple example of simulating the surf zone (simulation: about 50 million particles, 5 second loop). For better quality watch in 4k.

The question is, would it be practical to use such an asset for game development if it required a lot of video memory, for example 250 Mbytes?

There are obvious flaws in the video (development is in progress), but it gives the general idea.

Yes, we have such plans. Now the work is far from complete. Many things need to be figured out.

Now I'm working on data compression, the small example of the simulation shown above now requires 700 MB of video memory for textures. I'm sure that we’ll get a compression ratio of 30-40%, totaling about 250 MB. This is just for the shoreline, also games may require: boat wakes, splashes, streams, etc.
In the first message I've paraphrased the questions I'm concerned about. I would be grateful if you could answer them.

I work on a maritime simulation. So I need to have all these feature. Very important is a boundless ocean and also boat wakes splashes and of course underwater view. Performance is of secondary importance because I don't want to support mobile platforms. Nevertheless I need enough performance to create realistic sceneries.

I really want to see an finished water asset of your work. I like the look and movement of the water. And the shoreline looks outstanding.

This years top gaming cards are averaging 8GB of VRAM and mid-range gaming laptops from 2015 like the one I have are in the neighborhood of 2-3GB of VRAM.

Now if the average game takes roughly 4 years for a team to build then it's entirely possible that the average gaming machine will have a minimum of 4GB's of VRAM by the time you are finished if that's not already the case now.

No matter what happens with that, what you are doing is entirely practical because it's amazing and everyone wants to see a game that looks that good.
Even if all you make is a tech-demo that most machines can't run, you'll have so many job and partnership offers that what you are doing will eventually come to something big. If you end up meeting someone who knows how to optimize your work then you have no problem at all.

If it's awesome, people will buy better machines just to play it. I haven't heard anyone say "killer-app" in a long time. Bring it back!

Wow. This is the best ocean asset that i have ever seen. I would love to feature it in my game or in upcoming projects. Are there any details about this being made public being available? I'd love to test it. The video shown looked amazing in a experimental state. Need a tester?

Digital ApeModerator

- Would it be practical to use such an asset for game development if it required, for example, 256-512 Mbytes video memory only for foam textures (or 1GB for more detailed flow)?

Click to expand...

I think some projects would have no problem with 256-512MB. A gig isn't practical for games but Unity serves many markets that don't care about limitations - they will throw more hardware at it (sim, military, arch vis, film)

- Also the asset will require approximately 250 MB of disk space for every 50 meters of the coastline. If the coastline has a similar structure, the data will be reused (250 MB for every 50 meters of the coastline, different in structure). Would it be practical?

Click to expand...

This is impractical for the scale given, for most games but again see the above comment, Unity doesn't just serve game markets

Ideally a solution like this for console games, would not cost more than 256MB of video memory and have a fixed storage size regardless of how much it's used, so some form of reuse would be interesting.

This is only my opinion in relation to things similar to my current project.

Hello,
The next question is how to design a game level with a shoreline. As far as I understand, the standard method assumes that firstly the sculpting of the terrain is made and then the ocean plane is placed. In this case, this method is hardly possible, the simulation will take a lot of time to calculate and a lot of disk space for storage.
To solve this, it is proposed to create a library of different types of shoreline, combining which (manually or procedurally) a level is created. By type of shore is meant a geometry that affects the behavior of the fluid near the shoreline. Color, texture, the presence of additional objects, whose difference in geometry does not affect the flow, can be arbitrary.

The shoreline will be constructed in two stages:
1. Drawing a spline;
2. Filling the shoreline with different types of shore along the spline.

wow. Will this be usable with other fluids like honey or lava as well?

Click to expand...

Yes, the possibility to simulate and render fluids with high viscosity is certainly present. In addition to the increased viscosity, for such fluids a more complex mesh should be used (not height map based). Right now work is underway to implement data compression for rendering complex surfaces (for example plunging waves).

Yes, the possibility to simulate and render fluids with high viscosity is certainly present. In addition to the increased viscosity, for such fluids a more complex mesh should be used (not height map based). Right now work is underway to implement data compression for rendering complex surfaces (for example plunging waves).

As soon as it goes on sale, you already have an insured buyer. I'll see how I put it in the game, but something so impressive must be in mine.
Games with asset of very high quality, they sell more powerful hardware to be able to play them. In addition the technology advances very fast ... the graphics cards already go by 11Gb of memory

Hello,
I would be very grateful if you could answer a few questions:
- Would it be practical to use such an asset for game development if it required, for example, 256-512 Mbytes video memory only for foam textures (or 1GB for more detailed flow)?

- Also the asset will require approximately 250 MB of disk space for every 50 meters of the coastline. If the coastline has a similar structure, the data will be reused (250 MB for every 50 meters of the coastline, different in structure). Would it be practical?

1) It's not very practical for most hardware to use that amount of video memory only for foam textures. So if you find ways to reduce it, your market will expand tremendously. Otherwise you will be limited to high-end hardware. Also many will try to run it on VR and if the system is running at 60fps only with a shoreline... the game will probably slow too much when adding all the other stuff.

2) The disk requirement you mention is also way too high. If 200 meters of beach requires 1gb of space... again, high end hardware and you'll be out of many potential markets.

So my suggestions...
1) Give a try to sell as it is now. You've get lot of customers that have high end hardware and don't mind all those crazy requirements. You'll also get some $ and real market use requirement metrics that will guide you through the following point...

2) Begin working on optimization and lowering quality. Tricks to probably discard memory batches at a given distance and replace them with lower quality particles/meshes the farther you are. Lastly, most of game developers would love to have a nice shoreline, but we don't need crazy quality and details. We just need something that looks better that what we have without slowing our game. All current shoreline systems that I know of, looks pretty bad.

To give you an idea, this level of quality would be way more than enough for most of us:

and

I hope I was helpful. Your shoreline rocks and I'd love to give it a spin.

I think here the first thing you should assess is what line you want to get for your asset (Quality / real simulation or performance).

Once decided that focus your project from there.

I understand that performance is something very very important and I think you should work to get the best possible performance, but if what you want for your asset is quality / simulation of reality, you can not sacrifice quality and visual realism to get more market, because you will always be tied by the quality you want for your asset ... so I would only be oriented to high-end / very high-end PCs.

From here my reflecsion of the old post ... The hardware advances extremely fast and the necessary requirements of disk, vram, etc that now seems crazy, in 3 years it can be something normal.

With this I do not say that I do not try to work at the maximum possible performance, but always from the perspective in which realism is not lost.

Other options are that the user who uses the tool can choose what kind of visual realism he wants and that each one chooses if he prefers more performance or more realism.

I do not know if this is a silly idea, but I say it in case it serves you ...

What if instead of creating an ocean asset like the one you do, you only create a shoreline asset that could be used with any other water asset?

Maybe this helps focus things differently so you can have similar results in realism for your asset without being brutal in performance.

Maybe the waves and foam that are generated, as you say are reusable, that you can choose the distance of coastline that would use that wave and foam data.

As @ creat327 says, that according to the distance to the camera or the player, waves and foam are executed with less quality LOD's style (The highest visual realism only for the first 10-15 meters from the camera or player) and things like that ...
Although I imagine that all these things you have already valued.

Techniques so that the only thing that is rendered of your asset is only what enters the frustrum of the camera.

Are you rendering the particles inside Unity - are you using your own particle in cell simulator or third party app?. Also, which ocean system are the demos? Aquas? playway? Tell us more on implementation, cheers..

Hello,
The next question is how to design a game level with a shoreline. As far as I understand, the standard method assumes that firstly the sculpting of the terrain is made and then the ocean plane is placed. In this case, this method is hardly possible, the simulation will take a lot of time to calculate and a lot of disk space for storage.
To solve this, it is proposed to create a library of different types of shoreline, combining which (manually or procedurally) a level is created.

Question:
Would it be convenient to use the above-described scheme for constructing a shoreline in the production of games?
I would really appreciate your answers.

Click to expand...

That would not really work for most games, and the approach just wouldn't mesh well with most of the terrain creation assets either. So you would have a very limited audience, like a small handful at best.

Also, realistic is often not what you want in games. A great example of this is Sea of Thieves which is getting all kinds of praise for it's water. And if you look closely you will see the water doesn't really behave like real water does in a number of ways by design.

Realism is usually faked to a large degree You find that sweet spot between the look you really want and the amount of control you need overall for gameplay reasons.

I would encourage you to just open source your approach. This isn't something you are going to be selling for any money really it's too niche even if you make it work., and that way you could get better feedback from people experienced at making games.

Are you rendering the particles inside Unity - are you using your own particle in cell simulator or third party app?. Also, which ocean system are the demos? Aquas? playway? Tell us more on implementation, cheers..

Click to expand...

Hello superjayman,
Thank you for your questions.

1.Simulation is performed using an own module based on the methods that can be for example found in Robert Bridson’s Fluid Simulation for Computer Graphics.
2.Particles are rendered with a standard point to quad geometry shader, about 1 million particles (only some of the foam, bubbles, spray particles from the simulation are rendered).
3.Water surface. For ocean waves the conventional FFT based ocean model is used. FFT is calculated in a compute shader, for rendering the water surface a standard method with tessellation shader is applied (closer to the camera - higher tessellation level).

Simulations in game engines fascinate me, both realtime runtime ones and the use of baked sim data. Baked varieties obviously have their own challenges in terms of tools for the baking process, amount of data generated and all the implications that come from dealing with that amount of data. The questions you are asking of potential users on this thread are certainly in tune with these challenges. There is also the successful blending of the baked aspects with whatever dynamic layers people require the system to respond to.

These certainly arent trivial challenges and they've thwarted my own (not ocean shoreline-related) efforts in the past. Especially data size issues. The increased focus on Unity for non-game purposes does at least offer a reminder that systems that have some impracticalities when it comes to games may still find productive use in other niches.

I would like to give useful feedback about the tooling side of things. But to do so I first have some questions regarding the overview of the spline & modular method that you provided a while back. I havent quite worked out how to word some of the questions, so I will start with just a couple:

When you talk about shoreline library items, is this a fixed set of items that come with your asset, or do we select an area of shoreline and it then runs the sim on that chunk, stores it, and allows it to be reused for another part of the shoreline that has same slope and other geometric detail?

Whats being stored, and to what extent are are dynamic options limited? eg is pretty much entire sim data baked, including an entire time cycle of waves crashing on shore? Limits to ocean roughness/wave height/speed as a result? Or something much more limited such as a frame of flow information over the geometry stored, and some of the sim is dynamic/realtime? I'm assuming that out in the open ocean its realtime FFT stuff, I'm referring to behaviour near and at the shore.

When you talk about shoreline library items, is this a fixed set of items that come with your asset, or do we select an area of shoreline and it then runs the sim on that chunk, stores it, and allows it to be reused for another part of the shoreline that has same slope and other geometric detail?

Whats being stored, and to what extent are are dynamic options limited? eg is pretty much entire sim data baked, including an entire time cycle of waves crashing on shore? Limits to ocean roughness/wave height/speed as a result? Or something much more limited such as a frame of flow information over the geometry stored, and some of the sim is dynamic/realtime? I'm assuming that out in the open ocean its realtime FFT stuff, I'm referring to behaviour near and at the shore.

Click to expand...

Thank you for your interest.

I think both options should be available (shoreline library, and simulation tool).

Realtime FFT based waves are blended with pre simulated flow in the surf zone. What can be controlled for FFT based ocean model is well known (spectrum, amplitudes). The pre simulated waves can be deformed in space time domain (angle, velocity, height) and of course several datasets can be recorded for the same shoreline segment and then can be used depending on the situation.

In this case construction a shoreline is close to designing a road (drawing a path, choosing building blocks along the path).

I'd love to see a short video showing you creating a shoreline, adding some pylons/walls along it, and then running in game, to get an idea of the workload involved. I will say it looks utterly incredible.

I'd love to see a short video showing you creating a shoreline, adding some pylons/walls along it, and then running in game, to get an idea of the workload involved. I will say it looks utterly incredible.

Oops...

"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.