mirror of
https://github.com/overte-org/overte.git
synced 2025-07-10 18:58:37 +02:00
Switch back to using the light's radius + spacing
This commit is contained in:
parent
6ecbdc6b9a
commit
a54e8206fa
1 changed files with 3 additions and 1 deletions
|
@ -99,12 +99,14 @@ float getLightShowContour(Light l) {
|
||||||
}
|
}
|
||||||
|
|
||||||
float evalLightAttenuation(Light l, float d, vec3 ulightvec) {
|
float evalLightAttenuation(Light l, float d, vec3 ulightvec) {
|
||||||
float radius = getLightSquareRadius(l);
|
float radius = getLightRadius(l);
|
||||||
float denom = d / radius + 1.0;
|
float denom = d / radius + 1.0;
|
||||||
float attenuation = 1.0 / (denom * denom);
|
float attenuation = 1.0 / (denom * denom);
|
||||||
|
|
||||||
// "Fade" the edges of light sources to make things look a bit more attractive.
|
// "Fade" the edges of light sources to make things look a bit more attractive.
|
||||||
// Note: this tends to look a bit odd at lower exponents.
|
// Note: this tends to look a bit odd at lower exponents.
|
||||||
attenuation *= clamp(0, 1, mix(0, 1, getLightCutoffSquareRadius(l) - dot(ulightvec, ulightvec)));
|
attenuation *= clamp(0, 1, mix(0, 1, getLightCutoffSquareRadius(l) - dot(ulightvec, ulightvec)));
|
||||||
|
|
||||||
return attenuation;
|
return attenuation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue