Sign in to follow this  

Trying to reproduce 3ds max's light attenuation calculation

This topic is 2539 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm exporting point (omni) lights from 3ds max into my engine, and I'm trying to reproduce approximately the same appearance when I render them. However, I'm having trouble getting the attenuation to match. I'm using Inverse Square attenuation in Max (none of the near/far attenuation settings), with a Decay Radius specified to control the rate of falloff (i.e. the "size" of the light).

The docs in Max give the following bits of information about computing attenuation:

Quote:

2- Inverse (Applies inverse decay. The formula is luminance=R0/R, where R0 is the radial source of the light if no attenuation is used, or the Near End value of the light if Attenuation is used. R is the radial distance of the illuminated surface from R0.)

3- Inverse Square (Applies inverse-square decay. The formula for this is (R0/R)2. This is actually the "real-world" decay of light, but you might find it too dim in the world of computer graphics.)

<light>.DecayRadius -- The distance over which the decay occurs.


The question is, what is R0, the "illuminated surface" and how does it relate to the Decay Radius parameter. The only thing I can think of, is to set up an equation like this:

attenuation = k/R^2

and tune k so that when R = DecayRadius the light has effectively fallen off to zero (and the scene looks like it does in Max).

I was hoping there would be a nicer way to figure this out than this though, so if anybody is familiar with how this works in Max or has any other ideas I'd love to hear them.

Thanks!

Share this post


Link to post
Share on other sites

This topic is 2539 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this