Adding a environmentTexture makes meshes translucent when glowlayer is behind them

All of my meshes become translucent when a glow layer is behind them after adding Environment HDR Texture. How can I make the meshes opaque? Video for clarification.

I am not sure how would that be possible :slight_smile:

Could you share a repro in the playground ?

There are other dependencies and such though feel free to download the code here. You should be able to run indev.html fine, though it will tell you to log in. To circumvent this just enter the following js into the console and reload:

ls.auth='30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 64 65 76';

This is really hard for the community to look into every custom projects, it would be really amazing to isolate the issue in the playground if possible ?

Have you tried to explicitely exclude the meshes from the glow layer (glowlayer.addExcludedMesh)?

I’ve been using glowLayer.addIncludedOnlyMesh though after trying out addExcludedMesh, it doesn’t appear to work either.

Unfortunately, the playground doesn’t have a way to use “raw” HTML apps. As for finding the issue, it appears to be because I’m using glowLayer.addIncludedOnlyMesh compared to the glowLayer.customEmissiveColorSelector from before.

For source comparison:
Infdev 2 (Previous version, working) - line 753
Infdev 3 (Still in development, bugged) - line 775
There are base64 encoded assets so it’s more readable if you turn off word wrap

But you do not need raw html, you should be able to repro with simple spheres and similar material / glow setup ?

I’ll try and make a repro.

1 Like

Hi @Vortex ! Just checking in, were you able to make a repro? :slight_smile:


No. I have not made a repro on the playground due to the complexity of the game dependencies and such… you can find it here (and access the source code with F12/Ctrl+U):

Unfortunately it is impossible for the community to enter deep in all the applications which are facing issues :frowning: I tried a couple things without success but whenever you find time to create a simpler repro this would be great as I am sure the issue could also exist for other users.


I’ve managed to recreate a repro in the playground! This should replicate the bug:


I have made a playground repro here since then.

It is not a bug, your highlight is just to bright:

basically if the ship is darker you can still see it cause the sum is not white

Thanks! Would it be possible to invert the effect (so that the ship becomes darker)? I also wonder if its possible to create a dynamic HDR/Environment Texture so that importing one (Babylon’s default in this case) isn’t necessary? I’ve looked into using a reflectionProbe but I haven’t gotten that to work yet.

Reflection probe would be the way to go. And about a darker ship, you can simply adjust its diffuseColor.

Hm… changing the diffuseColor doesn’t appear to affect the mesh:

As you are using a pbr material you need to tweak the pbr equivalent called albedoColor:

Yes, though it does not make the mesh opaque (The star still shines through). How would I change this so that the star does not shine through?