Different light setting for each child

Hi
I have a gltf object in my scene. There are many childs in this object. Also have 5 lights. I just want one of my lights to light up a specific child, not all.

Is that possbile?

I am using directional lights.

thanks.

Such a feature is called “selective lighting” and not yet supported.

light.channel is working for all light types?

and all materials have lightChannel option?

There is no channel property. Are you referring to layers?

Ok
I used this code for lighting

lamp = new THREE.DirectionalLight(0xffffff, 1);
lamp.position.set(10, 0, 20);
lamp.shadow.bias = -0.00009;
lamp.shadow.normalBias = 0;
lamp.channel = 1;

is this correct use? and which one is correct;

child.lightChannel = 1

or


child.material = new THREE.MeshPhongMaterial({
side: THREE.DoubleSide,
lightChannel:1
});

thanks…

Sorry but the related PR is not merged. You can’t use channel or lightChannel.

sorry Mugen87 but I am beginner on three.js…what is PR?

PR means “Pull Request”. There is a PR at GitHub trying to implement selective lighting but it was not merged.

The new WebGPURenderer with its node based material will support selective lighting. There is already a demo demonstrating this feature. However, this is not available for WebGL.

than we are using WebGLRenderer and cannot use channels. Right?

Yes, what you are trying to achieve does not work right now.

You can try to render different scenes with different light setups but it’s an inconvenient workaround.

123

as you see golden frame shinning so much. we are giving light for gray part because it must be lighter…
we want to light up only gray child…this is our problem…

if you want to see our page code you can check;

https://yeni.elbielectric.com/urunler/zena/silverline/fildisi/topraklipriz/