Can we have a material to be transparent if it receives no light (From spotlight ideally)

Hello!

I’m doing some test in WebXR where I use a spotlight, I would like that objects (or part of them) that doesn’t receive light become transparent.

Alternatives

Using a projective material on the object would work but it’s not as clean as using the spotlight that doesn’t need to create custom materials for all scene objects

Any ideas? Someting like a shadowMaterial but for light?

Cheers :slight_smile:

You might want to explain that a bit more. By transparent, do you mean effectively invisible or partially see through? And what is the goal with doing that?

A start would be to check out the shader code responsible for spotlight illumination here

Thanks!
Sure I might end up doing a copy of the PhongMaterial and add a way to modify the opacity depending on the light receive?

More clearly I want in WebXR (on Quest 3) to use light in my living room, so imagine I create a plane that I put on my physical Wall. I want it to be transparent (so I see reality) but I want it to react when I project a light on it, a threejs red spotlight should make my physical wall look red .