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 Kailas · Apr 30, 2012 at 09:54 AM · physicsrigidbodymobileconstraintsliquid

Smoothed Particle Hydrodynamics

Hi Guys.

I'm making a 2D game in Unity that involves absorbing certain liquids (water, lava, acid) and doing stuff with them. I've been looking into fluid simulation techniques and the best one I've come across is Smoothed Particle Hydrodynamics, which basically involves simulating the water using lots of particles that need to interact both with each other and with other stuff in the level.

I've come up with two theoretical ways of proceeding:

  1. Use sphere colliders and rigidbodies on the liquid particles.

  2. Simulate the particle collisions myself and somehow have them interact with other objects in the level.

Using PhysX to simulate the liquid using spheres is highly undesirable from a realism and performance standpoint (particularly since it's a mobile game).

Simulating the particles myself means that I also have to make them interact with other objects. I have no idea how I would "represent" the other objects in the fluid simulation so that the particles not only stay outside the colliders of other objects, but also apply forces to them.

Here are a couple of games I've come across with the sort of liquid physics I want: Pixel Junk Shooter http://www.youtube.com/watch?v=6IsZAa899SY Spewer http://www.newgrounds.com/portal/view/494129

Does anyone know of a good way to do this sort of thing?

Also, if I went with the first method (using sphere colliders) and I froze all of the rotation constraints on the rigidbodies, would it be any more efficient than having them unconstrained? My reasoning is basically that PhysX should be able to tell that two objects are both unable to rotate and thus not bother calculating torque, but I can also see why it might not do that.

Comment
Add comment · Show 2
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 The-Oddler · Mar 15, 2013 at 05:49 PM 0
Share

Ever got this to work properly?

avatar image TarahPeltz · Apr 16, 2017 at 05:29 AM 0
Share

Did you ever get this to work? I'm writing a thesis on fluid simulation and for my purposes, SPH in Unity would be far more desirable than a standalone shader.

0 Replies

· Add your reply
  • Sort: 

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

6 People are following this question.

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

Related Questions

Freezing X and Y rotation not working (rigidBody) 1 Answer

How can I constrain physics in all directions except one? 2 Answers

Why are a rigidbody's freeze constraints not working? 2 Answers

Add 2d rigidbodies to moving objects to increase performance or not? 1 Answer

Detecting Input on ~100 Objects 2 Answers


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