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
3
Question by coding_crow · Oct 03, 2014 at 11:11 PM · cullingshuriken

Can I force Shuriken to recalculate its bounds properly after using SetParticles() ?

There is an old problem with Shuriken where the whole particle system gets culled when its center is off screen. There are also some suggested workarounds to be found, but none of them work for me. First let me clarify that there seems to be two possible causes for this problem. One has to do with scaling, and I've read some people who fixed it by setting the scale of their Shuriken transform to (1,1,1), others who have added a sub-emitter and got it to work. In my case, I believe the problem is a different one, and the above fixes didn't work. I tried to pinpoint the problem, and here is what I found:

When using SetParticles() to set all the sizes, positions, etc from a script, the renderer.bounds property has Extends(0,0,0) afterwards, which explains why the whole system will be culled when its center is out of view. A standard, non-scripted Shuriken will recalculate its bounds constantly while playing and will account for all the individual particles, thus still rendering when any are in view.

Now I wonder if anyone knows how exactly these bounds are calculated - maybe I need to script-set some other property of the particles or the system so it can calculate the bounds correctly? Or maybe I can force the Shuriken or its renderer to recalculate the bounds after calling SetParticles()?

[edit] If there is a way to call ParticleSystem.Play() without overwriting my script-set particle data, I assume that might help as well, as I believe the reason it does not update its bounds might be that it has to be stopped or paused in order for the scripted data to take effect.

[edit] I also tried giving the transform a mesh renderer and -filter in hopes there would be one bounding box per transform, but that didn't do it either. So there seems to be no way to influence renderer bounds and shuriken culling at all? Can someone confirm that?

[edit] I just read, in an answer to this post, that the particle system "uses a single mesh". Is there a way to access that mesh? When/how is it created? I'm sorry if I ask too many questions in one post, but an answer to any of them would enable me to at least try some more things to get it to work. So they're all pointing to the same problem, I hope that's fine. If there's any way to improve my question please let me know - I've been fighting this problem on and off for years now.

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

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by morbidcamel · Oct 08, 2014 at 06:10 AM

I have the same problem. If I leave the particle system in the scene for some reason it works. If I instantiate it or scale the particles themselves (not the transform) the .SetParticles method does not recalc its bounds and its driving me nuts. I am using shuriken specific functionality like collisions (which is supposed to disable frustrum culling but does not!)

I have logged multiple bugs and even added a few suggestions http://feedback.unity3d.com/suggestions/please-add-the-ability-to-disable-automatic-culling-on-particle-systems

Comment
Add comment · Show 1 · 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 coding_crow · Oct 11, 2014 at 02:10 AM 0
Share

The bug has been known for a while, I think when I first encountered it in 2012, it was already filed - at least some form of it.

avatar image
0

Answer by coding_crow · Oct 05, 2014 at 01:00 PM

Ok so for anyone who comes across this thread and has similiar problems: I just tested using legacy particles instead, as described here, and from the first look it seems to work nicely - I can pan around the particle I created with the emitter way out off screen and it still shows, so if you don't need any shuriken-specific functionality, this is a workaround that helps without recalculating every particle in world space, which I did before.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Changing sub emitter via script? 1 Answer

Accessing Shuriken particle system values through a script in C# 3 Answers

How do I create a Shuriken moving particle system? 0 Answers

Scripting Shuriken 1 Answer

Shuriken - Any idea what causes '!CompareApproximately (SqrMagnitude (axis), 1.0F)' error when switching to mesh particles? 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