# Spotlight cutoff question

This topic is 3205 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I'm using the following equation to compute attenuation for my spotlight so that it will: spotDot = dot(-vLight, spotDirection); spotAttenuation = pow(spotDot, spotExponent); where vLight is the vector from the surface to the light and spotDirection is the direction the spotlight is pointing. If a point is outside the cutoff, I set the attenuation to 0. This is then multiplied with the diffuse of the surface to get the final colour. Everything looks good, but there's still a sharp change in the colour around the area of the spotlight cutoff unless I use higher exponent values. Am I doing something wrong? Or am I supposed to be taking a parameter for the inner cone and outer cone to allow a spotlight to transition smoothly between lit areas and the shadow areas outside the cutoff?

##### Share on other sites
Quote:
 Original post by YellowMapleOr am I supposed to be taking a parameter for the inner cone and outer cone to allow a spotlight to transition smoothly between lit areas and the shadow areas outside the cutoff?

That's how I like to do it. You can use smoothstep to make the transition nice and smooth.

1. 1
2. 2
Rutin
16
3. 3
4. 4
5. 5

• 26
• 9
• 11
• 9
• 9
• ### Forum Statistics

• Total Topics
633715
• Total Posts
3013497
×