Reuse shader material with different properties for particles

I have a number of meshes (text) that uses a shader to draw.
I want to bring in some variance where I can set properties per mesh such as color, scale, …
We are creating a composite mesh for each word and then the particle system to render copies of repeating words. (we have found that the particle system gives us the best performance).

Is there a way for me to define changes where I want to still use the same shader but pass in variance for the same word.

For example I have the word “Mon” and normally it is black but there are cases when I want it to be white. I still want to use the particle system for performance but for that “white” particle pass in parameters that override the default shader attributes.

Not sure if this is possible but if it is, I would appreciate any assistance you may have to offer.

1 Like

Hello! That should be possible with the particle update function: Customizing Particles | Babylon.js Documentation (babylonjs.com) :slight_smile:

Aah that is brilliant Thanks @carolhmj.
@Gerhard_Meyer I guess you have some more toys to play with :slight_smile:

This example looks like it is doing a update per particle.

2 Likes