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?
@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.
@labris in above code https://playground.babylonjs.com/#LRFB2D#323, 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.
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) => gl.name === ${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) => gl.name === ${nodeId});
let mesh = scene?.meshes?.find((mesh) => mesh.name === ${nodeId});
if (gl && mesh) {
gl.addIncludedOnlyMesh(mesh);
gl.intensity = intensity;
}
}
};