-
Notifications
You must be signed in to change notification settings - Fork 33
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 colour while breaking blocks #209
Comments
I attempted this a while ago. Some notes about how they are implemented now (mostly from memory, might be incorrect):
So we end up with a few problems. For example if we want to scale particles with age, all particles are scaled equally. Same goes for colors. A few solutions:
|
I wouldn't think having different meshes per block would be that expensive. We could even have a modifiable limit for particles, for example forbidding the creation of more, when there are over 100 being rendered. Particles could still share the same mesh by block for optimization, but that shouldn't be a restriction, I would say particles have to be really flexible for future modders. |
In case someone changes particles: I was considering adding a gravity multiplier to particles. Right now, all particles are affected by gravity regularly (so, 1x multiplier). Some things don't make sense to do that, like fire or smoke. A multiplier would allow this to be set per-particle (hopefully isn't noticeably performance degrading) while still respecting the actual gravity. |
Could've sworn I said something here, maybe I forgot to click Comment. We used to have this, but in the blur of trying to find out what was making Iceball get progressively slower and slower, I ended up forcing blocks to use the same static mesh (it was using a different mesh for every particle). Reverting to the old behaviour puts it at risk of fragmenting the GPU memory and making other things slow, so for this to work we'd ideally want to limit it to one static mesh per broken block. If we want this to go faster, we'd probably want several points in a mesh, as there's a somewhat notable delay every time you call glDrawArrays, and calling it about 3000 times a frame makes things slow. We are not streaming vertices to the GPU just so we can make block breakage look fancier. We could possibly invest in a shader, though... |
Currently the particles are a boring gray when you break or blow up blocks. Maybe it would give a nice effect if the particles were actually the color of the block being destroyed?
The text was updated successfully, but these errors were encountered: