How to darken/lighten a part of a mesh

Hello everyone, I’m developing a minigame where you have to point the spotlights to the center of the painting and then the not dark image will show up. The thing I want to do is: first of all have the image darken (with overlayColor or with another mesh above with opacity), but the difficult part here and the thing I don’t know how to do is to show the part of the picture that is darkened in full colour where the spotlight points to. This spotlights can rotate obviously. I attach the current minigame to show the idea i want to do.

do I understand correctly that you only want the part that is lit by the spotlight to be seen and the rest to be dark?

Welcome to the forum! :slight_smile:

1 Like

This is not very clear (sry). One thing I can say is that if you want your texture to show only under light, the emissiveColor, emissiveTexture.level and diffuseColor and diffuseTexture.level are the parts you want to work.
May be you could set up a quick PG and/or be a bit more explicit about your needs?
Like I don’t really understand this:

Isn’t it that you wanted to say:
“you have to point the spotlights to the center of the painting and then the dark image will show under light” ?

2 Likes

Yes exactly, I want the part that is lit by the spotlight to be seen clearly, and the part which is not lit, to be dark (not black but dark which means that you can see a little bit of the painting)

Thanks for the answer. The thing here is that there is a dark painting in the back and I want the part of the painting that is lit by the spotlight to be seen clearly with the original texture, making with that the effect of the light.

Something like this? (move your mouse over the ground)

PGDemo | Babylon.js Playground (babylonjs.com)

This has two lights. That’s one way of achieving this :slight_smile:

5 Likes

Hey there just checking in, was your question answered? @jaume_armengol