-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Particle Systems #5212
Particle Systems #5212
Conversation
…d life, and also a normalizedAge
…be set each time the entity moves
…nstead use a min/max
…ition to velocity vector
Making the placer control the initial velocity vector. Fixed startScale/endScale initializers.
@pjcozzi This is ready for another review. Since your last review, I added tests, updated CHANGES.md, and addressed all of your comments. I'm working on an additional Sandcastle example, but that can be a separate PR. |
I added better memory management so its not adding and removing billboards causing constant VAO creation/destruction. Also, added a new Sandcastle example. |
Are we sure this should have so much alphaed blank space around it? That is a lot of wasted fillrate. |
In the Sandcastle example, the "Show" button turns off the aircraft but not the particle system. |
Just those comments. Very close! |
I would submit an issue. The problem is the memory management again. Sometimes more particles are created than was estimated and they get removed later. This causes the number of commands from the billboard collection to change. For every new command, it generates the OIT shader and looks it up in the cache. |
@pjcozzi This is ready for another look. |
Submitted #5522 |
Thanks again @jasonbeverage @bagnell! @jasonbeverage what's next?!?!? 😃 |
This is so cool! |
Thanks again for working with me to get this merged! I'll hopefully have a couple more PRs before the end of the year ;) |
Really looking forward to them, any teasers??? |
No teasers yet, still working on what they will actually be :) |
Me again 😄
This PR adds particle system support to Cesium. This work is a conglomeration of ideas from:
I'm sure you'll have plenty of feedback on this one so I wanted to get it out early.
I've got a live demo you can play with here:
http://cesiumparticles.netlify.com/apps/sandcastle/?src=ParticleSystem.html&label=Showcases
Originally I was going to write a fully GPU based particle system (I hacked one together using OpenSceneGraph, see this video) but ultimately just ended up doing it all on the CPU. The GPU solution is really interesting for when you need to render a massive amount of particles for something like a water or super realistic fire effect, but it also complicates integrating logic that doesn't lend itself well to being fully implemented on the GPU. For example, in my early work on this I was able to integrate the Cannon.js rigid body engine into Cesium with pretty minimal code which would have been really difficult to do on the GPU. You can see a prototype video here
Some notes about the design
The time is the amount of time into the particle system simulation loop before the burst is applied and it will emit somewhere between min and max particles on the burst. ParticleSystem also has a loop option, which is mostly just used to reset the bursts when it's done looping.
Things I know that still need to be done:
Wiring up the "complete" event on particle systems through the entity framework so you can script particle systems.Thanks!
Jason