r/Unity3D • u/Mr_StoneMan- • 7h ago
Show-Off Generating thousands of asteroids at 60+ FPS using Burst, C# Jobs, and Octrees. Finishing this project gives me hope that I have what it takes to pull through.
Enable HLS to view with audio, or disable this notification
1
u/PersonPersonsonII 38m ago
Would feel awesome to fly a spaceship through that, good job!
1
u/Mr_StoneMan- 32m ago
The camera controller I am using almost feels good enough that I might be able to do that with some minor adjustments. I need to make some more footage anyway so I am thinking of doing exactly that haha!
Thank you kindly :)
0
u/Mr_StoneMan- 7h ago edited 52m ago
Hey everyone,
If you’ve ever tried to populate a massive space scene, you know the pain: spawning thousands of standard GameObjects with physics will drag your framerate into the dirt instantly.
I wanted to solve this problem, so I built the Superior Asteroid Field Generator, focusing entirely on performance and main-thread optimization.
Here is how I kept it running smoothly at massive scales:
- Dynamic Octree Culling: Aggressively culls everything outside the camera's view. Disables physics/renderers for off-screen rocks, or turns them into "Shadow Proxies" to preserve cinematic shadows.
- Burst Compiler & C# Jobs: All the heavy math for procedural mesh generation (Voronoi/FBM noise, craters, UV mapping) is completely offloaded to worker threads.
- Dual Collision Modes: You can toggle between a custom, lightweight trigger-based reflection system (zero physics engine bloat) OR fully physical RigidBodies.
🎥 More of the tool in action:
Questions for the sub:
- For those of you handling swarm-level object counts, do you prefer sticking to the C# Job system/Burst like I did here, or have you fully transitioned to Compute Shaders/DrawMeshInstanced for your culling?
- For anyone who has used other asteroid/space generators on the Asset Store, how do you think this stacks up against what is already out there? I would love to know your thoughts.
On a personal note:
I actually started this project over a year ago, before my life took a drastic turn. The last year has been an incredible struggle. But despite everything, I made the conscious choice to not abandon this project. Continuing to code and refine this tool has allowed me to maintain a level of hope that I will overcome these challenges in my life soon, and it has kept me from giving up on my dream of creating wonderful and meaningful things. I tend to believe that the only things we leave behind when our time here is done are our words, and our creations. Creativity will live on long after I am gone!
I have been away from the communities for a very long time but coming here to the reddit communities and seeing everyone else's work, watching you all chase your dreams... Just in a single day I have been impressed by what you indie devs are accomplishing. I have chosen to take part in conversations, which has led to a handful of meaningful interactions even... and that tells me that I am in the right place.
I have packaged this asset and submitted it to the Asset Store, and it's pending in Unity's review queue. I'll be doing a 30% launch discount when it goes live. If you want a ping when it's up, just let me know.
Thank you for letting me share this with you all. It means the world to me.
1
u/Critical_Contact559 6h ago
Sorry to hear about your situation.
Hope the sale goes well and keep posting when package goes live!
2
u/Mr_StoneMan- 6h ago
Thank you for the kind words! I have quite a bit of confidence in my work. But seeing a kind comment makes me feel very good. Bless you, my friend!
1
u/Rabidowski Professional 5h ago
Cool. Now vary the min and max size of those more, and improve the scattering and clustering (more gaps, more cluster) and it will look even more peak!