Modifying the Glow Layer to support a Texture Atlas mesh setup

@sebavan I believe you are the godfather of the Glow Layer so tagging you :slight_smile:

I’m wondering if there is a way to modify the glow layer to work with a texture atlas instanced mesh setup, i.e. if I have meshes with transparency data in an atlas, the instanced mesh will show the entire atlas glowing if I attempt to use the glow layer. If that is confusing, it’s obvious from playground:
https://www.babylonjs-playground.com/#GPW8E9#9

(Ignore all the color stuff, if you look at the first number you’ll see what I am trying to do).

I know I’d need to pass in the cellInfo and options attributes like I’m doing on the atlas shader (and modify the vUV accordingly), but I’m not sure which of the glow layer shaders I would need to modify, and also will the glow layer be able to read the attributes I declared with registerInstancedBuffer? (if it’s possible theoretically, I’m good with overriding the glow layer shaders to only work with my texture atlas instanced meshes).

Maybe you could try to use the mesh material directly with the new referenceMeshToUseItsOwnMaterial ??? https://www.babylonjs-playground.com/#GPW8E9#10

This seems to be EXACTLY what I’ve been missing from the glow layer, and solves this issue as well, thank you!

1 Like

not able to run this , i think i have similar problem, would be great if you could send again.It’s showing _ is not defined

https://www.babylonjs-playground.com/#GPW8E9#51 the issue was with lodash in the previous PG, not sure why it was in there :slight_smile:

still not able to run :smiling_face_with_tear:

Here’s my issue, Would be great if you can help with this How to make glow shader to mimic the Car led's animation happening nowadays

It is way too early :slight_smile: so lodash is actually needed and was not yet loaded in the first PG.

I added some 3 sec delay so you can get an idea of how it works: https://www.babylonjs-playground.com/#GPW8E9#52