Talk:Constant-Linear-Quadratic Falloff: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
m (Never mind, I made an error. I was right before.)
Line 1: Line 1:
==Possible Wrong==


I don't know where to even BEGIN finding the formula that Valve used in HL2 to calculate their attenuations, so I've brought the formula for how to calculate over from "Edit Life", trusting them for now. It looks roughly like this:
I = Intensity
d = distance from light source
Q/L/C = amount of attenuation types
f(d) = (I(Q*(100^2) + L*100 + C))/(Q*(d^2) + L*d + C)
If this is true, then I've made some great miscalcs about this article, because
for a 100% quadratic light we simply get (100^2*I)/d,
for a 100% linear light we get 100*I/d, and
for a 100% constant light, we get I/d.
This means that the decline of a 100% quadratic light isn't quadratic itself. It's just 100 times greater than a 100% linear light.
A 100% linear light is in its turn only 100 times greater than a 100% constant light.
The decline of a constant light isn't constant either. It's just I.
...so this means that these different q/l/c scales are really just about how FAST/BIG to set the decline of the intensity, and NOT HOW the light declines. This also explains why the 100% constant light still seems to decline somewhat, if you look closely, which it shouldn't if the light was constant.
Right now I'm thinking that if I (and Edit Life) am right, then the math is simply flawed (i.e. A programmer forgot that square has priority over multiplication, perhaps.) because if Valve just wanted a simple I/d decline, they would only use one value for it. --[[User:Andreasen|Andreasen]] 10:02, 17 Aug 2007 (PDT)

Revision as of 10:30, 17 August 2007