Fluid Renderer: opaque shading mode + per-particle size – want to contribute, looking for API feedback

Hi @Evgeni_Popov, hi all :waving_hand:

This is my first topic so first of all want to say thanks everyone for supporting Babylon.js comunity! Hope it keeps growing and becoming more popular.

I used FluidRenderer to build a foam effect (particles poured from a bottle) for a commercial project, and ran into two small limitations that I worked around locally. I’d like to upstream them properly if there’s interest.

Playground demo: Babylon.js Playground – shows both patches applied at runtime via ShaderStore/prototype patching.

  1. Per-particle size – right now every particle in a fluid render pass uses the same global size, even when the particle system already has its own per-particle size (e.g. shrinking over lifetime). Would be nice to support that.
  2. Opaque shading mode – fluid rendering always does glassy refraction. An option for a simple opaque, lit look would open it up for foam, milk, paint, lava, etc., not just water.

Would love your thoughts on whether these fit, before I put together a PR. Will be happy to make some contribution :backhand_index_pointing_right: :backhand_index_pointing_left:

2 Likes

Sounds good to me, bear with us while @Evgeni_Popov is out, he ll be back really soon :slight_smile:

1 Like

Sure! I’d be really happy if my work proves useful) There’s more on the way :wink:

1 Like