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 KEELAN · Dec 28, 2014 at 12:10 PM · performanceparticle-systemfluid

Particle based fluid simulation optimizations help

Hi, I am implementing a 2D particle based fluid simulation, got it mostly working but the performance was horrible. This was expected as I was making a quick prototype.

The first prototype used a gameObject for each particle which a circle collider and to find the neighboring particles I used Physics2D.OverlapCircleAll. Using the physics engine like this was VERY slow. I could only get around 80-100 particles before the framerate crashed under 10fps.

Then after doing some research to optimize it, I used a spatial hash to keep track of the particles and find the neighboring ones. Then to render it I used unitys ParticleSystem.

I still have issues. I then ran timers for each of the methods and it yielded this

No Particles: 552
ApplyExternalForce :0
ApplyViscosity :1
AdvanceParticles :0
UpdateNeighbors :13
DoubleDensity :6
WorldCollide :0
ParticleRender :0
UpdateVelocity:0

with a total of 20ms for the all the calculations. BUT the frame time shown in the stats window at the same time had a time of 361 ms. And even turning the rendering off for the particle system has no real effect. Even commenting out the code that applies the particles to the particle system has no effect. The system stays relatively stable but around the 500 particle mark there are massive decreases very quickly going from 40-50 fps to 2-5 fps in less than a second.

The particle renderer used the default shader and sprite, only gameobjects in the scene is the particle manager and the main camera.

This is a big improvement but the algorithm I implemented was for mobile devices and ran over 3000 particles on a single thread.

Can anyone tell me why there is such a slow down here or any advise on the matter?

Regards

Comment
Add comment
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

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

26 People are following this question.

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

Related Questions

Non-convex mesh collider vs box collider perfomance 0 Answers

Performance issue with code 0 Answers

Working On A Sudo Fluid System 1 Answer

Spacedust - Change specific particles 1 Answer

How do I get my game to run faster? 4 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