Instancing + selective bloom

Hi community!
Nothing special, I just wanted to know how the selective bloom will work with instanced meshes.
To be honest, I’m not sure that I chose the correct way in using of .onBeforeCompile(). :thinking: Criticism and advice are welcomed.

Here is a pic

And there is a working demo:

You can find a music video from youtube at the bottom right corner of the window. Just for better atmosphere of the scene :blush:

PS Special thanks to @marquizzo for pointing to the function of noise in shaders. :beers:


Can you explain to me how make with material in object 3d :slight_smile:

Looks awesome. Though I didn’t find any boxes :slight_smile:

1 Like

Good eye! :smile:
They were boxes before they became spheres :slight_smile:
Thanks! :beers:

Oh! For working with materials and their modifications, you’d better read articles from @pailhead.
For example, this good one: Tutorial for modifying materials

1 Like

My only suggestion here is not to push the uniforms from the onBeforeCompile but push them into.


myMaterial.userData.uniforms = { myUniform }

myMaterial.onBeforeCompile = shader=> shader.uniform.myUniform = myMaterial.myUniform

You can also bind onBeforeCompile. This way you have your uniforms already during instantiation, you don’t have to wait for three to do it’s… thing :frowning: