-
- /* solve distance for linear lights */
- else if( (light->flags & LIGHT_ATTEN_LINEAR ) )
- //% light->envelope = ((intensity / light->falloffTolerance) * linearScale - 1 + radius) / light->fade;
- light->envelope = ((intensity * linearScale) - light->falloffTolerance) / light->fade;
-
- /*
- add = angle * light->photons * linearScale - (dist * light->fade);
- T = (light->photons * linearScale) - (dist * light->fade);
- T + (dist * light->fade) = (light->photons * linearScale);
- dist * light->fade = (light->photons * linearScale) - T;
- dist = ((light->photons * linearScale) - T) / light->fade;
- */
-
- /* solve for inverse square falloff */
+
+ else if( (light->flags & LIGHT_FAST) || (light->flags & LIGHT_FAST_TEMP) )
+ {
+ /* solve distance for linear lights */
+ if( (light->flags & LIGHT_ATTEN_LINEAR ) )
+ light->envelope = ((intensity * linearScale) - light->falloffTolerance) / light->fade;
+
+ /*
+ add = angle * light->photons * linearScale - (dist * light->fade);
+ T = (light->photons * linearScale) - (dist * light->fade);
+ T + (dist * light->fade) = (light->photons * linearScale);
+ dist * light->fade = (light->photons * linearScale) - T;
+ dist = ((light->photons * linearScale) - T) / light->fade;
+ */
+
+ /* solve for inverse square falloff */
+ else
+ light->envelope = sqrt( intensity / light->falloffTolerance ) + radius;
+
+ /*
+ add = light->photons / (dist * dist);
+ T = light->photons / (dist * dist);
+ T * (dist * dist) = light->photons;
+ dist = sqrt( light->photons / T );
+ */
+ }