Any ideas why glowLayer is turning White?

Hi team,
I have this playground where I have a giant robot and a cube covered with textures.
My issue is with glowlayer turning white on the Robot whereas it is pink-ish (as it should be) on the cube.
Both models have the same textures

Here is the playground:

Any ideas why this is the case?

You set an emissive color (0.19, 0.19, 0.19) to the box but not your model, when I set the box’s emissive color to white, they glows the same.

1 Like

When exporting from your dcc, check the application of emissive colors.

Emissive color values ​​of existing robots

Apply the same as the emissive value of the cube

Emission color values ​​of existing cubes

1 Like

Hi,
To the above, I would add two comments:

  1. You should make a separate mesh, submesh or at least material for your glowing parts.
  2. Doing this will allow you to have more control over how these parts glow (and may affect surrounding materials/meshes). In particular, @tanpopo and @11128 are both correct in that the glowLayer uses the emissive (color and/or texture) to emit glow. This also means that this emissive color/texture can be affected by direct light. Separating your glowing meshes from your non-glowing meshes will allow you to set levels to the emissive and direct light for these parts. Typically you can ‘explode’ the level (emissiveIntensity or emissiveTexture.level in case of using a texture. Next to avoid these parts turning white when close and under direct light, you can compensate by setting the directIntensity (on PBR Mat) to a negative level. This way you can get very strong emissive/glow also in the distance.

Edit: Here’s the link to a thread that might be of interest to you:

2 Likes

I appreciate the help team;
I gave up and implemented something that’s a bit of a mix of all of your solutions

I create a temporary Material and am using gl.setMaterialForRendering(mesh, tempMat)

let tempMat = new BABYLON.PBRMaterial('newMat', scene)
  tempMat.metallic = 1.1
  tempMat.roughness = 1
  const emissive = await GetAsyncTexture(`${path}textures/Emissive_2048.jpg`, false)
  tempMat.albedoTexture = emissive
  tempMat.metallicTexture = null
  tempMat.albedoColor = BABYLON.Color3.Black()
  tempMat.emissiveTexture = emissive
  tempMat.emissiveColor = new BABYLON.Color3(0.1, 0.1, 0.1)
  tempMat.emissiveIntensity = 0.5
  tempMat.directIntensity = -10
  tempMat.disableLighting =true
  tempMat.environmentIntensity=0.1

  let gl = new BABYLON.GlowLayer('glow', scene,{
    mainTextureSamples:2,
  })
  gl.neutralColor = new BABYLON.Color4(0, 0, 0, 0);
  gl.intensity = 0.3
  gl.blurKernelSize = 32

  robotMeshes.forEach((m) => {
    if(m.material){
      m.material.emissiveColor = new BABYLON.Color3(0.1, 0.1, 0.1)
    }
    gl.setMaterialForRendering(m, tempMat)
  })

It’s not giving the result I hoped I’d get, but it’s better than what I had.

To be honest, I don’t quite understand this approach. I’m not sure of which parts you want to be glowing but I’d rather think those are the ones from your new emissiveTexture, correct?
Well, these arent’ really glowing at this moment, from what I can see.
And now you have two gl, nearly doubling the number of draw calls for a visual result I’m not too sure of.
Of course, my opinion only.

Edit: Rushed version (sry) but I was thinking it would be more something like that (not sure about the color though). Yet, I may be wrong, am I?

That is my fault, I completely forgot to clean-up :wink:

Your rushed version is how I expect it to look; However for a reason I never mentioned I can’t hardcode the color like in your playground; (some giant robot have different color emissive). I’m really trying to have a glow effect that uses the color from the emissive texture rather than turning white;

I have somewhat obtained the result I want in this playground using the node material manager:

You can see the difference with the original playground

The light is blue in my playground rather than turning white;

In the node material I removed the white color and passed the emissive texture again;

The problem is that this isn’t really generating a PBRMaterial so I can’t just give that nodeMaterial to the robot;

I guess you could assign an id to your meshes/submeshes (and or materials) or an identifier within the id that makes them part of group and use ‘split’ or ‘includes’ to select a group and assign whatever specifity you need for this ‘group’.