EmissiveIntensity not working

Hi,

  1. I need to make an object to glow. For that, I set the emissive color to white. But I couldn’t control the emissive Intensity. I change the value for emissive intensity to control the intensity. But there is no effect while changing the value.
  2. I need the occlusion depth effect in a pbr material. For that, I set the Occlusion Texture at the metallicTexture , and set true at the useAmbientOcclusionFromMetallicTextureRed . I think it is working. But I need to increase the intensity of the depth .

How to do these two things?

You can control the glow intensity as described here - Making Meshes Glow | Babylon.js Documentation

var gl = new BABYLON.GlowLayer("glow", scene);
gl.intensity = 0.5;

As for the point 2 of your question - I am not sure that I understand what you are trying to achieve. Playground example would be definitely helpful to answer to your question.

1 Like

Thanks for your reply @labris. If I use this GlowLayer for glowing, The mesh selection for glow is difficult to handle. I have more than 100 meshes in the scene, and I need to make a single mesh to glow. So I need to add all other meshes to glowExcludedMesh right?. If this is the only one way, then what is the use of EmissiveColor and EmissiveIntensity?
And My second question is about enabling the occlusion depth from occlusion Texture.

You can use addIncludedOnlyMesh to only include some meshes (see doc).

Regarding the intensity of the occlusion effect, you can use the level property of the texture object.

Thanks for your reply @Evgeni_Popov . For occlusion effect, your solution doesn’t seem to work. Can you please share any example or playground regarding this

Note that for occlusion you also have the ambientTextureStrength property which is the strength of the effect, 0 meaning no occlusion effect and 1 full occlusion.

Basically:

ao = ao_read_from_texture * ao_level
ao = linear interpolation between no_ao (white) and ao. The interpolation factor is `ambientTextureStrength`

In order to include only a subset of meshes in the glow layer you can use the dedicated function:

var gl = new BABYLON.GlowLayer("glow", scene);

gl.addIncludedOnlyMesh(mesh)

Using the function will automatically switch mode and only render the included meshes.

If you need even more control over your meshes you may use tagging function - Tags | Babylon.js Documentation

EmissiveColor sets the color of emission. Comment the line 16 to see the difference - https://playground.babylonjs.com/#LRFB2D#30

Thanks for your reply @labris & @Evgeni_Popov . It is working, But While doing this, the glowing mesh is able to seen even through other meshes. It makes other objects transparent feel. i.e ., it is refracted through all other meshes. How to solve this.

Could you provide a repro in the Playground so that it’s easier to see what’s going on?

1 Like

Sure. I will make it