Comments and answers for "What is the proper way of calculating attentuation in Unity3D non-surface shaders?"
http://answers.unity.com/questions/566012/what-is-the-proper-way-of-calculating-attentuation.html
The latest comments and answers for the question "What is the proper way of calculating attentuation in Unity3D non-surface shaders?"Comment by Karnsteiner
http://answers.unity.com/comments/567399/view.html
So A and B are user-set constants set to achieve a certain type of fallof then? I saw this equation on a few sites referencing OpenGL's default light attenuation, but I guess I didn't understand that the linear and quadratic factors were actually user manipulated.Fri, 01 Nov 2013 10:39:54 GMTKarnsteinerComment by Owen-Reynolds
http://answers.unity.com/comments/567022/view.html
A and B are just tweaks. Dividing by D^2 is real-world correct, but can give too small a circle. Dividing by D makes the light go a little too far. Dividing by D^1.8 might work, but a pain to compute. So, use a mix of /D and /D^2, determined by A and B.
1/(0.2D+0.8D^2) will be a little more puffed-out that just 1/D^2. If they don't add to one, no problem, but it just cancels out the brightness on top and makes it harder to read.Thu, 31 Oct 2013 15:55:22 GMTOwen-ReynoldsComment by Stampyturtle
http://answers.unity.com/comments/566677/view.html
What factors do A and B represent in that equation? I've looked at some of the standard math, but this is what I was presented in the overwhelming majority of the tutorials I've seen for Unity CG shaders as how to calculate attenuation. Thank you for the plug on better attenuation formulas though, I've found better research for them since you posted. I've found since then that its not simply an attenuation problem anymore. See the updated question from my profile in just a moment.Thu, 31 Oct 2013 00:26:35 GMTStampyturtleComment by Owen-Reynolds
http://answers.unity.com/comments/566401/view.html
Have you looked at the standard attenuation math? It's been pretty well set for a decade, and not too difficult to read. The 1/(1+AD+BD^2) formula, where you tweak A and B.
I'd guess that just 1/D isn't giving enough fall-off. Then the "box" is Unity saying "O$$anonymous$$, the light is done for sure by now -- stop using it."Wed, 30 Oct 2013 16:35:51 GMTOwen-Reynolds