mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-14 11:46:34 +02:00
Remove no longer necessary light vector parameter.
This commit is contained in:
parent
180f4ba4f5
commit
ff3fca3dc3
3 changed files with 4 additions and 6 deletions
|
@ -98,10 +98,8 @@ float getLightShowContour(Light l) {
|
|||
return l._control.w;
|
||||
}
|
||||
|
||||
// Light is the light source its self, d is the light's distance, and ulightvec is the unnormalized light vector.
|
||||
// Note that ulightvec should be calculated as light position - fragment position.
|
||||
// Additionally, length(light position) != dot(light position, light position).
|
||||
float evalLightAttenuation(Light l, float d, vec3 ulightvec) {
|
||||
// Light is the light source its self, d is the light's distance calculated as length(unnormalized light vector).
|
||||
float evalLightAttenuation(Light l, float d) {
|
||||
float radius = getLightRadius(l);
|
||||
float denom = d / radius + 1.0;
|
||||
float attenuation = 1.0 / (denom * denom);
|
||||
|
|
|
@ -67,7 +67,7 @@ void main(void) {
|
|||
vec4 shading = evalFragShading(fragNormal, fragLightDir, fragEyeDir, frag.metallic, frag.specular, frag.roughness);
|
||||
|
||||
// Eval attenuation
|
||||
float radialAttenuation = evalLightAttenuation(light, fragLightDistance, fragLightVec);
|
||||
float radialAttenuation = evalLightAttenuation(light, fragLightDistance);
|
||||
|
||||
// Final Lighting color
|
||||
vec3 fragColor = (shading.w * frag.diffuse + shading.xyz);
|
||||
|
|
|
@ -74,7 +74,7 @@ void main(void) {
|
|||
vec4 shading = evalFragShading(fragNormal, fragLightDir, fragEyeDir, frag.metallic, frag.specular, frag.roughness);
|
||||
|
||||
// Eval attenuation
|
||||
float radialAttenuation = evalLightAttenuation(light, fragLightDistance, fragLightVec);
|
||||
float radialAttenuation = evalLightAttenuation(light, fragLightDistance4);
|
||||
float angularAttenuation = evalLightSpotAttenuation(light, cosSpotAngle);
|
||||
|
||||
// Final Lighting color
|
||||
|
|
Loading…
Reference in a new issue