Original Post
I''m working on a high level API that will be able to incorporate both Direct3D and OpenGL. This has went fairly smoothly, but I have now stumbled over a small problem. We have decided to use a simple range value for lights in the engine (to simplify creation of bounding spheres etc...). The problem is that OpenGL uses an attenuation formula (constant, linear, quadratic) to represent distance attenuation. So my question is: how can I, given a simple range value calculate constant, linear and quadratic values that I can use in OpenGL but that will still visually correspond with Direct3D.