Adding a environmentTexture makes meshes translucent when glowlayer is behind them

this is the entire point of the glowLayer :slight_smile: You can not really bypass it as it is renderered full screen on top of everything. I your case I would suggest to bake it in you sky texture.

1 Like

What do you mean by “bake it into your sky texture”?

You could place it in the starbox if to be seen from far away or you would need a custom shader for what you are trying to achieve.

The main question is why using this gl.addIncludedOnlyMesh(star); in your scene if you do not want the glow to bleed ?

1 Like

The reason I’m adding the glowLayer is because of the visual improvement - take the below screenshots for example:


with glowlayer

without glowlayer

Since the ship’s emissiveColor is black you can add it the glow layer with addIncludedOnlyMesh as well (or don’t call addIncludedOnlyMesh at all) without making the ship glow. Then even when the ship is overlapping the star it’s mostly unaffected by the glow layer… :slight_smile:

2 Likes

Wow! Thanks!

1 Like

@Blake,
Why are your doing imported.meshes[1] and not 0?

I think it’s because meshes[1] is your model’s mesh, the one that has vertices and is drawn so can be affected by glow, while meshes[0] is the root mesh that Babylon adds to convert from the gltf model’s right-handed format to Babylon’s left-handed format by rotating and scaling it (it’s not actually drawn itself so can’t glow I guess). :slight_smile:

1 Like

Thanks again!

1 Like