It is currently Sat Aug 22, 2020 4:53 am


All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Recommendations for water simulation?
PostPosted: Tue Dec 16, 2014 9:55 pm 

Joined: Tue Dec 16, 2014 8:55 pm
Posts: 3
Hey so I've been looking a bit at Cubiquity, particularly looking at the smooth voxel terrain example for a game project I'm trying to see is viable. From a tech standpoint I would have floating islands with player deformable terrain (at runtime obviously).

This looks to be possible after expirimenting a bit - but as I want to have water on the island, and the terrain is deformable, I guess I will need some form of fluid physics in the case that a player digs around a lake.

I realize this is *much* easier said than done, and I've looked around to learn a bit about the process. Lot of 2D stuff, but 3d fluid sims are very sparse because of the complexity involved. It certainly doesn't look like there is a turnkey solution for something like this, but was wondering if you had any thoughts, or, more to the point, anything in the works or experimenting with.

I've seen this Terrain Engine (https://www.youtube.com/watch?v=1axTirlOkvI) is doing a MarchingCubes type of system which seems like the most realistic (and by that I mean in terms of feasability).

I've also considered trying to "fake it" by using something like Fluvio2 (https://www.youtube.com/watch?v=mhs4S9Vkl_s) as a fluid sim for particles from a waterfall, along with standard water planes. Basically it would reduce the height of the initial waterplane for each particle generated, and as the particles settle, a new waterplane would be created and increased in height when enough particles land in a particular area.

However this seems like it would only work well in controlled environments and slopes and other edge cases could present problems that might invalidate the method for this usecase.

At any rate I'm just brainstorming, let me know your thoughts :)

Thanks,
Jesse


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Recommendations for water simulation?
PostPosted: Wed Dec 17, 2014 10:49 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
I think there are a couple of approaches you can consider. Firstly, there is an add-on for Cubiquity called 'Liquid Voxels'. It is not developed by us and currently only supports the cubic-style terrain (I think) but the developer has mentioned supporting smooth terrain in the future. You can read about it here:

Liquid Voxels: http://forum.unity3d.com/threads/liquid-voxels.242821/

Secondly you have the option of an existing SPH-based fluid simulator like Fluvio, and perhaps extending it with something like screen space fluid rendering (http://developer.download.nvidia.com/pr ... ffects.pdf). The real question here is whether Fluvio can handle enough particles to look convincing, and how expensive the collision detection with the terrain is. You could try it at least - even with the standard Unity terrain if you're not ready to dive in to Cubiquity.

We don't have any plans to do work on fluids ourselves, but if you find that Cubiquity would benefit from certain features to make fluid simulation easier then let us know.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Recommendations for water simulation?
PostPosted: Wed Dec 17, 2014 3:22 pm 

Joined: Tue Dec 16, 2014 8:55 pm
Posts: 3
Oh thank you very much for the response! I hadn't seen Liquid Voxels! (And I thought I did some pretty extensive Googling for all things Voxel Water and Fluid Simulation related to Unity).

I will take a look at that and experiment with it, but from what I see, I feel like that is going in the direction I want to head.

The Fluvio/Screen Space Fluid Rendering looks interesting, but I think you're right that enough particles to look convincing factoring in the terrain collision might be too expensive to approach with current tech. Also using this for all water (as opposed to supplementing water planes during "waterfall" points - which probably won't even work) would give me more detail than I would actually need.

It seems like Liquid Voxel's method of using a 3 dimensional array and not collision seems like a faster and better way to go. I also wonder if it could work in the following way with smooth voxel terrain:

Image

Essentially operating in a cubic-format that it's currently doing but allowing the water cubes to go into areas on the border of the Volume Data that aren't completely "filled". In the above pic, there are 5 cubes worth of water, falling off a cliff. 3 of these cubes should "realistically" be displaced - however that wouldn't actually be necessary for practical gameplay, and in terms of rendering the Water Voxel could clip right through the Terrain Volume Data. I think this would save unnecessary calculations compared to a more "Realistic" Fluid simulation like Fluvio.

Coupling that with some rules that round off the edges of the borders of the Water Voxel and the right shader, and I think that could be a pretty convincing Smooth Water Voxel simulation.

Of course, much easier said than done, plenty of edge cases, and some of this stuff is pretty far over my head (I'm more of a "Designer who Programs") - but I will run it by the author of Liquid Voxels and see what he thinks.

Also I really appreciate your decision to offer the full featured evaluation the way you have. The price is extremely reasonable, but as an indie it's hard to throw that amount around here and there simply to try things out. I'm still in an experimental stage for this future project, but as soon as I figure out some of the big tech stuff, this will be one of the first things I buy for it :)

Cheers,
Jesse


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Recommendations for water simulation?
PostPosted: Thu Dec 18, 2014 9:01 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Yes, I think in principle the water simulation can be extended in the way you describe. Instead of being just full or empty, the level can be on a scale from 0-255. This should match well with the way marching cubes works. But really the liquid voxels guy is the expert here :-)


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net