How to create multiple instances of glowlayers with different intensities around the geometrical objects?

I want to create multiple glowing objects with different intensity. But it is applying same intensity on all objects. How should I apply two different intensities to glow layer?

    <glowLayer name={'box1'} intensity={2}>
      <box name={'Green1'} position={new Vector3(0.95, 1.1, 5.92)} size={0.15}>
        <standardMaterial emissiveColor={ new Color3(1, 1, 0)} />
    <glowLayer name={'box2'} intensity={5}>
      <box name={'Green2'} position={new Vector3(2.5, 1.05, 5)} size={0.15}>
        <standardMaterial  emissiveColor={ new Color3(1, 1, 0)} />

You may try to imitate different intensity with alpha channel -

1 Like

@labris thanks for the reply. But in above example, both (object and box) are glowing with same intensity value at the same time. But I want to glow two objects are different value of intensity at the same time.

User should able to observe that one object have higher glow than other.

The code I created, glowing both boxes with same intensity thought different intensity values are given to them.

Maybe this example will help -


@labris thank you. I will try like this.

@labris in above code, alpha component is different for both objects, but same intensity is getting applied to both boxes at the same time.
I want to keep alpha component same, but want to apply different intensity to both boxes.

Here is the example with 2 boxes and 2 glow layers with different intensity -

1 Like

Hi @labris, In my scenario, glow is not getting added to the mesh. I have created one mesh having multiple children. and want to add glow to all children in that mesh. I below code, nodeId is name of Parent Mesh.

// To create glowlayer in mesh
useEffect(() => {
let scene = engRef?.current?.engine?.scenes[0];
Object.keys(draggedLightsData).map((key) => {
if (scene) {
let isLayerPresent = scene?.effectLayers?.find((gl) => === ${draggedLightsData[key].nodeId});
if (!isLayerPresent) {
const gl = new GlowLayer(${draggedLightsData[key].nodeId}, scene);
gl.intensity = 0;
}, [draggedLightsData]);

// To change the intensity of mesh
const onChangeIntensity = (nodeId, intensity) => {
let scene = engRef?.current?.engine?.scenes[0];
if (scene) {
let gl = scene?.effectLayers?.find((gl) => === ${nodeId});
let mesh = scene?.meshes?.find((mesh) => === ${nodeId});
if (gl && mesh) {
gl.intensity = intensity;

<box name={lightData.nodeId.toString()} position={new Vector3(x, y, z)} size={0.1} isVisible={false}>
{lightData?.data?.map((light) => (
<box name={${lightData.nodeId}-${light.outputId}} position={new Vector3(x, y, z)} size={0.02}>
<standardMaterial emissiveColor={new Color3.Magenta()}/>


after adding intensity to glow layer, my mesh( displays children meshes only) is looking like in image. But actual glow is not getting displayed.

Can you please help me with this?

Can you iterate through child meshes using



on each of them?

Thank you @Takemura and @labris . It is working as expected.

1 Like

I think since you need only meshes getChildMeshes() is better for this operation - TransformNode | Babylon.js Documentation

Oh I posted wrong link, because I got to that page by getChildren, ofc it is getChildMeshes.

1 Like