Tweak light attenuation.
Doesnt really change the look of the light but reduce their extent.
This commit is contained in:
parent
9ac57c3919
commit
18aa119890
@ -32,8 +32,7 @@ void main()
|
||||
vec3 light_pos = pseudocenter.xyz;
|
||||
vec3 light_col = col.xyz;
|
||||
float d = distance(light_pos, xpos.xyz);
|
||||
float att = energy * 200. / (1 + d + 4. * 3.14 * d * d);
|
||||
float spec_att = energy * 200. / (1 + d + 4. * 3.14 * d * d);
|
||||
float att = energy * 200. / (1. + 33. * d + 33. * d * d);
|
||||
|
||||
// Light Direction
|
||||
vec3 L = -normalize(xpos.xyz - light_pos);
|
||||
@ -41,5 +40,5 @@ void main()
|
||||
float NdotL = max(0., dot(norm, L));
|
||||
|
||||
Diffuse = vec4(NdotL * light_col * att, 1.);
|
||||
Specular = vec4(getSpecular(norm, eyedir, L, light_col, roughness) * NdotL * spec_att, 1.);
|
||||
Specular = vec4(getSpecular(norm, eyedir, L, light_col, roughness) * NdotL * att, 1.);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user