spotlight smooth edges?

I think I remember a topic about this but I cant find it. So how can you change the smoothness of the spotlight edges?

PS. The 8 light limit applies to spotlights as well, right?
Is it also for the shader generator?

What do you mean by smoothness?
Are you talking about vertex-lit vs. pixel-lit or do you want a larger falloff distance on the light?

Per-vertex or per-pixel shouldnt have any effect on this.


Isnt it obvious?

panda3d.org/reference/python … tlight.php

I thought exponent was it, but i cant get the desired effect.

I could also try using my own texture, but it wont be possible with shader generator, as it works like a projected texture. At least thats what the description says.

No it was not obvious from your description what you meant, which is the reason why I asked for clarification.

Does setExponent have any effect at all? You may also have to adjust the FOV to get the right look.

If you look at the first image, exponent changes the brightness concentration from center to edges, inside the white spot. It doesn’t change the smoothness of the edges of the spot.

EDIT: Whatever, just see for yourself:

import direct.directbase.DirectStart
from pandac.PandaModules import *
from direct.gui.DirectGui import *

render.setShaderAuto()

# terrain
env = loader.loadModel('environment')
env.reparentTo(render)
env.setScale(0.02)
env.setZ(-4)

# spotlight
slight = Spotlight('slight')
slight.setColor(VBase4(1, 1, 1, 1))
lens = PerspectiveLens()
slight.setLens(lens)
slnp = render.attachNewNode(slight)
render.setLight(slnp)
slnp.setP(-90)
slnp.setZ(20)

# sliders for changing lense FOV nd Exponent
slider = DirectSlider(range = (0,180), value = 30, pageSize = 1, command = lambda: lens.setFov(slider['value']))
slider.setZ(-0.4)
slider2 = DirectSlider(range = (1,100), value = 50, pageSize = 1, command = lambda: slight.setExponent(slider2['value']))
slider2.setZ(-0.6)

run()

Oh, yes.
What you want is basically an inner cone on the spotlight before the exponent kicks in.
Panda doesn’t seem to have such a feature, but you might be able to get the same result if you are able to set the colour/brightness on the light higher than 1.

I updated my previous post.

From the API ref it seems that it hasn’t. But I remeber a topic about this before, I dont know what solution there was.

Maybe its possible that the custom texture approach uses a different technique and wont screw up the shader generator. Worth a try.

… and maybe you still don’t understand what I want.