Created
June 27, 2014 13:17
-
-
Save tobspr/e93111989e00d2ed6fff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Cut light transition starting at 80%. Otherwise it's exponential and never gets really 0 | |
float cutoff = light.radius * 0.8; | |
float cutoffFactor = 0.25; | |
attenuation *= 1.0 - smoothstep(0.0, 1.0, ((distanceToLight / cutoff) - 1.0) * 4.0 ); | |
attenuation = max(0.0, attenuation); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment