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

From Valve Developer Community
Jump to navigation Jump to search
m (Clearified the formula, I think.)
No edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Possible Wrong==
Thanks for this page. TRUE '''user:StreetStrider''' 11:52, 22 February 2009 (UTC)


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:
Seconded. Absolutely brilliant... bookmarked! [[User:Saul|Saul]] 17:41, 28 October 2009 (UTC)
 
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, 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)

Latest revision as of 10:41, 28 October 2009

Thanks for this page. TRUE user:StreetStrider 11:52, 22 February 2009 (UTC)

Seconded. Absolutely brilliant... bookmarked! Saul 17:41, 28 October 2009 (UTC)