Glowlayer works unproperly when changing gl_position in pbrcustommaterial while BlurPostProcess works well

PG: https://playground.babylonjs.com/#540BEL#5
I’ve tried many other kinds of postprocess and they all work fine. Only glowlayer’s effect didn’t catch the change of gl_position.

Off topic, worldViewProjection is not defined by default in pbrcustommaterial, maybe this should be mentioned in the document.

This is expected as the glow layer is using its own material not expecting vertex changes.

You can use your own material in it referenceMeshToUseItsOwnMaterial(sphere); https://playground.babylonjs.com/#540BEL#7

3 Likes

However in this way not only emissive but albedo will effect the color of glow, I’ll try to see if it is possible to use only vertexShader or just use something else like bloomEffect to glow meshes. Thank you all the same!

A possible way to hack: https://playground.babylonjs.com/#540BEL#10.
Didn’t know why but reflectivityColor must be black.

1 Like