How to obtain fading lights?

Hello,

how can I obtain fading lights? I mean, all the lights should be gradually fading to 0.
I’m working with a Spotlight and I was wondering if there exist a parameter similar to Blender lights’ “Power” which allows to easily turn lights on/off and set their intensity…

The problem is that I’m quite clueless…I haven’t find posts which treat such issue.

P.S: setExponent(), in this case, seems to have no effect…

exp = #No matter what(0,1,10000) all is the same....
light = Spotlight('slight')
lens = PerspectiveLens()
light.setLens(lens)
lightNP = render.attachNewNode(light)
lightNP.setPos(0,0,2)
lightNP.lookAt(0,0,0)
light.showFrustum()
light.setExponent(exp)
self.lights.append(lightNP)
render.setLight(lightNP)

P.P.S: I’m using simplepbr(not sure if that matters)

One thing that you could do is to fade the light’s colour down to zero. You could also perhaps alter the light’s attenuation parameters–although that might be less intuitive.

(I don’t use simplepbr myself, so I don’t know how it responds to any of these things; fading the light-colour should be a safe guess, however.)

Yep, just tried and, it works. Actually it was quite intuitive…do you think that posting the code could do any good? :slight_smile:

1 Like

It may! Someone else might come along in the future with a similar question, and benefit from an explicit demonstration of the approach. :slight_smile: