Tweak light extent again to improve perf

This commit is contained in:
Vincent Lejeune 2014-05-05 01:46:57 +02:00
parent 849467d281
commit d316263660
2 changed files with 3 additions and 3 deletions

View File

@ -45,8 +45,8 @@ void main()
vec3 light_pos = pseudocenter.xyz;
vec3 light_col = col.xyz;
float d = distance(light_pos, xpos.xyz);
float att = energy * 200. / (1. + 33. * d + 33. * d * d);
float max_d = 20. * energy;
float att = energy * 20. / (1. + d * d);
float max_d = 5. * energy;
att *= (max_d - d) / max_d;
if (att <= 0.) discard;

View File

@ -86,7 +86,7 @@ vec4 ComputeClipRegion(vec3 lightPosView, float lightRadius)
void main(void)
{
float radius = 20. * Energy;
float radius = 5. * Energy;
vec4 Center = ViewMatrix * vec4(Position, 1.);
Center /= Center.w;