Strange behavior of SelectiveBloomEffect when working with InstancedMesh

:point_up_2: Here is scene with my problem:
Regular objects are highlighted properly, but if I use InstancedMesh and change positions for instances using BufferAttribute, the effect doesn’t apply to them.
Note the strange artefact when the middle triangle is near to zero position. Like during one of the rendering passes, the shader positions setting is not applied.

Please, help me fix it or hint any workaround :pray:

Thank you.

Is this the result you expect?

The usage of InstancedMesh does not look right. Try it with:

1 Like

I kept the using of ShaderMaterial :sweat_smile: :

1 Like

Cool, both your solutions works as I expect. But why doesn’t it work in my case? My example is a part of a more complex code with a non-trivial vertex shader, which is used to draw a huge number of objects, and their position (and size) depends on other attributes. That’s why I chose the solution to compute the position in the shader.