djeedai / bevy_hanabi

🎆 Hanabi — a GPU particle system plugin for the Bevy game engine.
Apache License 2.0
907 stars 72 forks source link

Ability to sample textures in modifiers #355

Closed msvbg closed 1 month ago

msvbg commented 1 month ago

Describe the solution you'd like Add the ability to sample a texture in Hanabi modifiers.

Describe why you want that solution. Is this related to a problem? There are a variety of ways this could be applied, like spawning particles in interesting patterns using pre-made textures (like Noita does), or crudely approximating 2D collisions on the GPU by intersecting particles with a world texture.

djeedai commented 1 month ago

@msvbg would you mind expanding on "like Noita does"? I'm always curious to learn about particle effect techniques, but I'm not familiar about any tech talk or presentation about Noita.

On the feature itself yes this is planned.

msvbg commented 1 month ago

I believe I got it from this place: https://noita.fandom.com/wiki/Modding:_Image_Emitters.

https://github.com/user-attachments/assets/ef2cf55c-ad0a-4dde-aa20-f488fec6547b

djeedai commented 1 month ago

Added some initial support. This is fairly limited but it should be easy enough to build on it to add more features.

msvbg commented 3 weeks ago

Interesting, I'll have a look at this later!