Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Anselm · Jan 03, 2012 at 02:23 AM · c#watereulerfluid

How to make a Realtime 3D Eulerian Fluid Simulation like “From Dust”, or something similar, in C#/Unity3D?

So, for a game project I'm going to be working on I need to make a fully working 3D fluid simulator in Unity3D using C#, that can work in real time.

The only problem is, I've never done anything like fluid simulation. I've been doing tons of research on it, and I think a Eulerian based fluid simulator would fit my needs best (just like this).

Basically what I need is something that can react to changing terrain and move realistically.

The people that made that simulator have a research paper online, and I've read through it. I understand the basics, but I have no idea how I could get that in to C# or Unity3D. So I was wondering if any of you could help me, either by linking to other fluid-simulators where the code is open source, so I can pick it apart and change it to my needs, or by giving me tips on where to start/what I would need to do.

I've spent hours looking online for fluid simulators, but haven't found a single one programmed in C# as of yet, I have a program that can convert C++ to C#, but I don't understand C++ well enough to know where to put the scripts in Unity once they're converted.

Any help at all would be extremely appreciated, I'm really interested in teaching myself how to make this system, but I just have no clue where I should start, or what has already been done that I could build off of.

Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image syclamoth · Jan 03, 2012 at 02:55 AM 0
Share

Probably you'd be best served to write it in C++ and then use it as a plugin called from native code. Fluid simulation is really complicated, as I'm sure you know, which is basically why people don't try to do it very often!

avatar image Anselm · Jan 03, 2012 at 03:20 AM 0
Share

Hmm...yeah, I was thinking I'd have to make a plugin in C++, C# doesn't seem to be flexible enough to pull off what I want. I found an asset that may work, we'll see. If you could show me in the right direction to find a fluid simulator coded in C++ that'd be great, otherwise i'll find one myself if I need it.

avatar image syclamoth · Jan 03, 2012 at 04:08 AM 0
Share

I've never really done much research about this- I'm pretty sure you'd know more about it than I would!

avatar image Bunny83 · Jan 03, 2012 at 04:26 AM 0
Share

as far as i can tell the simulation in this video uses CUDA on NVIDIA cards. If you haven't done something like this before, you better look for a ready-to-use solution. You won't get such a solution for free. That's "golden" technology and i guess not very easy to implement into Unity. Unity is really a fabulous engine, but to do such low level stuff efficient you really need to wrap your head around that stuff.

Just in case you've missed that: tallCells.pdf

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Winterblood · Jan 04, 2012 at 12:56 AM

This is cutting edge technology, using all sorts of advanced maths to make it accurate and advanced programming to make it fast. Here are the underlying equations that even simple fluid sims use: http://en.wikipedia.org/wiki/Laplace%27s_equation

I've been programming games for over a decade, and I would run a mile from fluid dynamics :) Unless you're comfortable with coding differential equations, I recommend designing around it or faking it using a simpler algorithm that's inaccurate but cheap.

Check out some of the simpler sims here, maybe you can adapt one to your needs: http://vterrain.org/Water/

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

A node in a childnode? 1 Answer

How do I make a sphere filling animation (optional: with a subtle waving) 0 Answers

Distribute terrain in zones 3 Answers

Multiple Cars not working 1 Answer

Raycast stops when false, even in update() 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"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.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges