Instancing + selective bloom

postprocessing
instancing
#1

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:

https://codepen.io/prisoner849/full/oRjjRy

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:

11 Likes
#2

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

#3

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

1 Like
#4

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

#5

@doum
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
#6

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

Ie.

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:

1 Like