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
1
Question by v_christf · Nov 17, 2014 at 03:13 PM · particlesparticle systemspaceasteroids

How to create a distant asteroid field?

Hi,

I want to create an asteroid field, which is visible from a distance, what do I use, is there an universal solution for this?

What I currently use: A particle system, which emits asteroids and when I get close they are replaced with actual asteroids. The texture for the particle system renderer is updated constantly using a separate camera, so the asteroids look better. I use the Texture Sheet Animation to simulate multiple asteroids. The problem with this solution is that it takes many draw calls and that there is no way to determine which frame(asteroid) does the particle use from the Texture Sheet Animation, so the Instantiate asteroids look different then the particles.

Can I access the Texture Sheet Animation frame property for a particle?

This is how it currently looks: Before Instantiate: alt text

After:

alt text

screen 0.png (219.7 kB)
screen 1.png (219.4 kB)
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 AlwaysSunny · Nov 17, 2014 at 03:52 PM

I think if I were approaching this problem, I'd want to leverage LOD (pro feature, but you can roll a passable LOD system on your own) and dynamic batching. Your particle idea is a smart one, but it won't give you the clean, seamless, functional results you're seeking.

For your other question, AFAIK, the current frame of a particle can only be discovered by using what I call age management, wherein each specific particle's age is repeatedly clamped to lie within a certain range. It's the only way to manipulate certain shuriken change-over-time modules like sprite animation. By controlling and knowing a particle's age, and by selecting the whole-sheet-over-lifetime option in the sheet animator module, you can know the particle's position on the atlas. This is not ideal for many obvious reasons, but it can be done.

Comment
Add comment · Show 6 · 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 v_christf · Nov 17, 2014 at 06:00 PM 0
Share

Hi, I wrote my own LOD to change the mesh according to the distance, the problem was with 1500 object it still lowered the frame rate to 10-30. With the particle system I was able to handle 1000-1500 objects with no problem, but then I was unable to seamlessly change to a prefab. Currently I use 6 different textures for 3 asteroids and create a screen capture of them, which I use for the particle system. Is there a way where I can batch the 6 textures to one material to lower the draw calls? (Or it works differently?)

avatar image AlwaysSunny · Nov 17, 2014 at 06:32 PM 0
Share

I'm not clear whether your speaking about meshes or particles in the latter half of that comment. If your asteroid mesh archetypes need 3 different textures, you could atlas them and change the uvs on your models accordingly to use only one material for all 3 variants. This will only save you a few draw calls though, assu$$anonymous$$g dynamic batching is working for you. The question doesn't seem to apply to particle systems, since I assume you've already atlas-ed the particle sprites based on your original question.

There isn't a great OOTB way to do what you're trying to accomplish with the distant-particles-are-placeholders thing. You just aren't going to be able to hide the transition into a 3d model unless it's very distant, like, 2% of screen real estate distant.

Even if you get the right model per particle, its orientation will not match a billboard sprite. Then there's getting light and fog to play along, and so on.

I guess if you really nailed the texture-getter and lighting and didn't $$anonymous$$d the orientation inconsistency, you could spawn your asteroid model behind its corresponding particle, then fade out the particle's alpha over time to attempt to hide the transition. You could also avoid the get-the-right-texture problem by using an individual particle system per asteroid archetype and only take a draw call hit relative to the number of variants.

avatar image v_christf · Nov 17, 2014 at 07:02 PM 0
Share

I use a camera which moves with the ship and has a few asteroids as child items, to match the light close to the ship, I was planning to use them as prefabs. Also I use particles, not meshes, the asteroids in-front of the ship rotate invert to the ship and the camera uses the picture of them as texture to the particle system, so the particles do not rotate with the ship.

Thanks for the quick answers, I think I got a few new ideas.

avatar image AlwaysSunny · Nov 17, 2014 at 07:16 PM 0
Share

Oh! Now I think I grasp what you're doing. Very interesting idea if I now understand correctly, but it sounds a lot like an uphill battle you might avoid with a different approach.

Leveraging dynamic batching, and optimizing your LOD system and other aspects of drawing and instantiation could win back the milliseconds your particle approach will supposedly save you.

avatar image v_christf · Nov 18, 2014 at 09:04 AM 0
Share

hi, made some progress and begin to use particle systems with mesh-es they look good, and I can handle big enough asteroid fields, but I'm back to my original problem kind of. Does the (pro) LOD change mesh-es for particle systems?

Show more comments
avatar image
0

Answer by StarvingIndieDeveloper · Apr 13, 2016 at 03:53 PM

This may be an old thread, but if anyone else is interested in the problem: one easy and realistic way to reduce the problem is to simply make a (realistically) more sparse asteroid field, because in real life I doubt asteroids are clustered as densely as in so many video games and movies (think about it). Simply spawn a smaller number nearby and then have distant billboards with a "foggy" pattern to simulate the more distant parts of the field. In between, have smaller billboards for individual asteroids at mid-distance, then replace them with meshes as you get closer. The latter can all be batched since they use the same material.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Particle System: How To Control Axis? 0 Answers

Sub emitter lighting problems 1 Answer

Particle systems doesnt instantiate in builded game 0 Answers

Particle system not outputting what it's supposed to. 0 Answers

how to turn on and off particles with key press 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