Tweak light extend.

This commit is contained in:
vlj 2014-05-03 23:44:27 +02:00
parent 5e62347d11
commit 35df307c3f
2 changed files with 4 additions and 1 deletions

View File

@ -46,6 +46,9 @@ void main()
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;
att *= (max_d - d) / max_d;
if (att <= 0.) discard;
// Light Direction
vec3 L = -normalize(xpos.xyz - light_pos);

View File

@ -29,7 +29,7 @@ const float zNear = 1.;
void main(void)
{
// Beyond that value, light is too attenuated
float r = 100 * Energy;
float r = 30 * Energy;
center = Position;
energy = Energy;
vec4 Center = ViewMatrix * vec4(Position, 1.);