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 danielmxli · Jun 02, 2015 at 05:02 PM · speedloopmobileoptimizationoptimize

Is it possible to change 1000 particles's positions in several particle systems without being too laggy on mobile?

I'm trying to recreate this by making it 3D, and on mobile. I've gotten my generating fractal code and particle system looping all set up, but it's super laggy on my computer.

Currently works as follows: 1. Instantiate 10 Prefabs of Particle Systems(each has say 1000 particles) 2. Within each prefab, I loop through each particle and adjust their position to create a fractal orbit 3. Emit 1000 particles repeat

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by tanoshimi · Jun 02, 2015 at 05:05 PM

Not really, no. Particle systems require a reasonable amount of processing power, and mobile devices are, well, primarily designed for making phone calls. If you must do it this way, I'd use a coroutine to spread out the cost of adjusting particles so that each one is only updated one frame in four, say. Other than that, you simply need to rethink your architecture.

Comment
Add comment · Show 3 · 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
avatar image danielmxli · Jun 02, 2015 at 05:22 PM 0
Share

Thanks! I would really like to implement this website on mobile, but I'm not very familiar with great design ideas. Perhaps you could shed some more light on some alternatives? I'll try implementing the coroutines to spread the adjustment of the particles. But, it doesn't seem like it'll be enough. Are there any other things I can do?

avatar image tanoshimi · Jun 02, 2015 at 05:58 PM 0
Share

Your game is a pipeline: it has a constant flow of data, starting at the player input and ending with the output rendered to screen. Along the way are a number of steps including all your game logic, physics calculations, audio processing, particle systems yada yada..

The speed at which data can flow through this entire pipeline is deter$$anonymous$$ed by the slowest component - the bottleneck - at which the most amount of data is trying to be pushed through the narrowest part of the pipe. So to optimise your game (or, in fact, any software application) you first need to work out what the bottleneck is. Trying to optimise anything other than the bottleneck is pointless. Unity comes with a profiler that will tell you how long each function takes to execute. Now, if your bottleneck is CPU-bound, it might be that you can move some of the particle calculations onto the GPU ins$$anonymous$$d (by, e.g. uploading a texture that encodes the various particle properties). If you're memory bandwidth bound, you could compress your textures. On a mobile device, you're more likely to be fillrate bound, in which case you need to reduce overdraw and simplify your shaders as much as possible - not using alpha transparency, for example.

But, without knowing what the bottleneck is first, you'd just be guessing.

avatar image danielmxli · Jun 02, 2015 at 06:55 PM 0
Share

Right. I've done the profiler part and figured out that it is the generation of the new positions for the particles that is causing a lag spike. The loop basically goes through each particle in the given system and adjusts their position one by one before setting the new particles to the system. It's quite slow, but I'm not sure if there's any other way about this? Do you have insight on this?

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

2 People are following this question.

avatar image avatar image

Related Questions

[Solved] Reverse animation help 2 Answers

How to loop an animation in reverse? 0 Answers

How can use C# to make a loop run at maximum speed without stalling game time? 3 Answers

Nested for-loop freezing Unity 0 Answers

Trouble checking against array objects 0 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