-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
Add option to draw particles when in Radial mode #66
base: develop
Are you sure you want to change the base?
Conversation
Thanks, that's a really cool effect! I like how you use the energy to change the speed and size of particles. I'm not sure about incorporating it into the module though, since it doesn't actually affect the spectrum. I think this can work just as well via the About the drawing order, the mirror/reflex effects currently don't make it possible to have something truly in the "background". If you draw too soon the particles will be replicated by these effects. This already happens with the level/dB scale. It would be necessary to use an extra canvas to solve this, but I'm afraid it would affect performance and/or complexity (copying one canvas content to another or keeping multiple layered canvases). I still need to experiment with OffscreenCanvas to see if it can help improving performance. |
Hey Hvianna, thanks for your reply and sorry for my very late response. I think a plugin approach would be very interesting, but it will require some design work as a plugin can potentially also extend / override functionality not related to drawing on the canvas. Also adding Typescript support for plugins will be interesting. I think for now, I will abandon this PR and move the code into my onCanvasDraw callback. |
Hi!
What does it do?
I thought it would be cool to add rendering of particles, that fly towards you from the center of the screen when
radial
is set to true.This creates a similar effect commonly seen in YouTube videos, e.g. any video from Trap Nation.
How does it work?
A particle spawns every frame. It spawns in a random location inside an invisible circle around the center of the screen. If every particle spawns from the exact center, it looks very unnatural.
When a particle is outside the canvas, it 'dies' and is removed from the array containing the particles to draw.
Remarks
showParticles
is on, and the user resizes / toggles fullscreen, the particles are temporarily still moving from their old position. The particles will die over time and disappear.I've updated the fluid demo to include the new
showParticles
property