• Create Account

### #ActualHodgman

Posted 31 May 2013 - 09:27 PM

One measures the distance as being 2 feet, and calculates a falloff factor of 1/4.
The other measures the distance as being 0.6096m, and calculates a falloff factor of 2.69.

Here you are mixing up relative and absolute measurements. You quoted "doubling the distance cuts the intensity by four"... now how do you go from doubling the distance to "2 feet"? Or more specifically, which distance did you double?
Doubling the distance would mean to go from 1 foot to 2 or from 0.3m to 0.6m in both cases you doubled the distance and quartered the intensity...

That example only contains absolute measurements. The "doubling the distance" bit was mentioned earlier, the way I've heard photographers explain 1/d2. This example only contains absolute d values being plugged into 1/d2.

Your falloff factors are relative to a distance of 1 in each of your respective units

Ah that makes sense! So when games use code like:

output = dot(n,l) * 1/(d*d) * intensity

then intensity is the value that you want the light to have at one unit from the centre... pretty obvious once I say it, since that's what happens.

And with the blog's formula, you're not setting intensity at 1 unit, you're setting intensity at the surface of the emitter. So the two formulas are give multipliers that should be used against different initial intensity values.

I guess seeing that the above code doesn't take steradians or areas into account anywhere, we're using some kind of assumption that all of our calculations are being done for some small-steradian-subtending small-area, which is the same for every one of our pixels? So if our game uses metres for everything, our light intensity value is in "light-units per small-area-at-1m-distance"?

If you bring the light 2x closer, it will get 4 times brighter, and with it being a point there's no limit to the number of times you can do this... so:

Also notice that while moving arbitrarily close to a theoretical point light source the energy doesn't go to infinity, the energy density does..

Thanks! So even if the light emits a quantifiable pulse of 100 photons, then at the moment of emission, there's always only 100 of them... but if your receiver was at the same point, with zero area, then we'd say there was 100 photons being received in zero area, which gives us a reading of infinity photons per m2!

In games, using the above code snippet as an example, we pretty much never take the receivers area into account (except for the N.L term). If we accounted for the actual world-size of the pixels that we're shading, and the solid angles that they subtend, would this cancel out the wackyness caused by the fact that the energy density approaches infinity? i.e. in order to measure that infinite energy density, our receiver have to have zero area, so you'd end up with something that's wacky in a different way, like ? Or we'd have a rectangular receiver area with most of it having zero energy and a single point on it's surface having infinite?

this formula doesn't work when the radius of the emitter is zero, so I'm still left puzzled about how to reconcile point emitters with spherical emitters. These two variants (1/d2 and 1/(d/r+1)2) give different answers

I figured this one out myself - it is possible to reconcile the two formulas:
In the formula from the linked blog, d is the distance from the outside of the emitting sphere to the receiver, and r is the sphere's radius. We can rearrange the blog's formula like so:

Importantly, d+r is the distance from the centre to the receiver, which is what the typical 1/d2 formula uses. So if we let D=d+r, and try and find an equivalnce with the typical formula, we get:

So, our typical 1/d2 formula is actually true for a sphere with radius of 1 unit (so again, your 'light intensity' game values are relative to 1 of your distance units). I guess this also implies you shouldn't trust it's answers for values of D that are smaller than 1, because such a situation should be unpossible, although the math does hold up until D hits zero

I'm still confused about the differences that occur depending on whether we treat our receiver as a spherical cap vs a rectangle though (with the 1/d^2 law being right for the spherical cap). Is this always the most appropriate geometrical approximation to be using?

### #4Hodgman

Posted 31 May 2013 - 09:20 PM

One measures the distance as being 2 feet, and calculates a falloff factor of 1/4.
The other measures the distance as being 0.6096m, and calculates a falloff factor of 2.69.

Here you are mixing up relative and absolute measurements. You quoted "doubling the distance cuts the intensity by four"... now how do you go from doubling the distance to "2 feet"? Or more specifically, which distance did you double?
Doubling the distance would mean to go from 1 foot to 2 or from 0.3m to 0.6m in both cases you doubled the distance and quartered the intensity...

That example only contains absolute measurements. The "doubling the distance" bit was mentioned earlier, the way I've heard photographers explain 1/d2. This example only contains absolute d values being plugged into 1/d2.

Your falloff factors are relative to a distance of 1 in each of your respective units

Ah that makes sense! So when games use code like:

output = dot(n,l) * 1/(d*d) * intensity

then intensity is the value that you want the light to have at one unit from the centre... pretty obvious once I say it, since that's what happens.

And with the blog's formula, you're not setting intensity at 1 unit, you're setting intensity at the surface of the emitter. So the two formulas are give multipliers that should be used against different initial intensity values.

I guess seeing that the above code doesn't take steradians or areas into account anywhere, we're using some kind of assumption that all of our calculations are being done for some small-steradian-subtending small-area, which is the same for every one of our pixels? So if our game uses metres for everything, our light intensity value is in "light-units per small-area-at-1m-distance"?

If you bring the light 2x closer, it will get 4 times brighter, and with it being a point there's no limit to the number of times you can do this... so:

Also notice that while moving arbitrarily close to a theoretical point light source the energy doesn't go to infinity, the energy density does..

Thanks! So even if the light emits a quantifiable pulse of 100 photons, then at the moment of emission, there's always only 100 of them... but if your receiver was at the same point, with zero area, then we'd say there was 100 photons being received in zero area, which gives us a reading of infinity photons per m2!

In games, using the above code snippet as an example, we pretty much never take the receivers area into account (except for the N.L term). If we accounted for the actual world-size of the pixels that we're shading, and the solid angles that they subtend, would this cancel out the wackyness caused by the fact that the energy density approaches infinity? i.e. in order to measure that infinite energy density, our receiver have to have zero area, so you'd end up with something that's wacky in a different way, like ? Or we'd have a rectangular receiver area with most of it having zero energy and a single point on it's surface having infinite?

this formula doesn't work when the radius of the emitter is zero, so I'm still left puzzled about how to reconcile point emitters with spherical emitters. These two variants (1/d2 and 1/(d/r+1)2) give different answers

I figured this one out myself - it is possible to reconcile the two formulas:
In the formula from the linked blog, d is the distance from the outside of the emitting sphere to the receiver, and r is the sphere's radius. We can rearrange the blog's formula like so:

Importantly, d+r is the distance from the centre to the receiver, which is what the typical 1/d2 formula uses. So if we let D=d+r, and try and find an equivalnce with the typical formula, we get:

So, our typical 1/d2 formula is actually true for a sphere with radius of 1 unit (so again, your 'light intensity' game values are relative to 1 of your distance units). I guess this also implies you shouldn't trust it's answers for values of D that are smaller than 1, because such a situation should be unpossible, although the math does hold up until D hits zero

### #3Hodgman

Posted 31 May 2013 - 09:19 PM

One measures the distance as being 2 feet, and calculates a falloff factor of 1/4.
The other measures the distance as being 0.6096m, and calculates a falloff factor of 2.69.

Here you are mixing up relative and absolute measurements. You quoted "doubling the distance cuts the intensity by four"... now how do you go from doubling the distance to "2 feet"? Or more specifically, which distance did you double?
Doubling the distance would mean to go from 1 foot to 2 or from 0.3m to 0.6m in both cases you doubled the distance and quartered the intensity...

That example only contains absolute measurements. The "doubling the distance" bit was mentioned earlier, the way I've heard photographers explain 1/d2. This example only contains absolute d values being plugged into 1/d2.

Your falloff factors are relative to a distance of 1 in each of your respective units

Ah that makes sense! So when games use code like:

output = dot(n,l) * 1/(d*d) * intensity

then intensity is the value that you want the light to have at one unit from the centre... pretty obvious once I say it, since that's what happens.

And with the blog's formula, you're not setting intensity at 1 unit, you're setting intensity at the surface of the emitter. So the two formulas are give multipliers that should be used against different initial intensity values.

I guess seeing that the above code doesn't take steradians or areas into account anywhere, we're using some kind of assumption that all of our calculations are being done for some small-steradian-subtending small-area, which is the same for every one of our pixels? So if our game uses metres for everything, our light intensity value is in "light-units per small-area-at-1m-distance"?

If you bring the light 2x closer, it will get 4 times brighter, and with it being a point there's no limit to the number of times you can do this... so:

Also notice that while moving arbitrarily close to a theoretical point light source the energy doesn't go to infinity, the energy density does..

Thanks! So even if the light emits a quantifiable pulse of 100 photons, then at the moment of emission, there's always only 100 of them... but if your receiver was at the same point, with zero area, then we'd say there was 100 photons being received in zero area, which gives us a reading of infinity photons per m2!

In games, using the above code snippet as an example, we pretty much never take the receivers area into account (except for the N.L term). If we accounted for the actual world-size of the pixels that we're shading, and the solid angles that they subtend, would this cancel out the wackyness caused by the fact that the energy density approaches infinity? i.e. in order to measure that infinite energy density, our receiver have to have zero area, so you'd end up with something that's wacky in a different way, like ? Or we'd have a rectangular receiver area with most of it having zero energy and a single point on it's surface having infinite?

this formula doesn't work when the radius of the emitter is zero, so I'm still left puzzled about how to reconcile point emitters with spherical emitters. These two variants (1/d2 and 1/(d/r+1)2) give different answers

I figured this one out myself - it is possible to reconcile the two formulas:
In the formula from the linked blog, d is the distance from the outside of the emitting sphere to the receiver, and r is the sphere's radius. We can rearrange the blog's formula like so:

Importantly, d+r is the distance from the centre to the receiver, which is what the typical 1/d2 formula uses. So if we let D=d+r, and try and find an equivalnce with the typical formula, we get:

So, our typical 1/d2 formula is actually true for a sphere with radius of 1 unit, which implies you shouldn't trust it's answers for values of D that are smaller than 1, because such a situation should be unpossible, although the math does hold up until D hits zero

### #2Hodgman

Posted 31 May 2013 - 09:18 PM

One measures the distance as being 2 feet, and calculates a falloff factor of 1/4.
The other measures the distance as being 0.6096m, and calculates a falloff factor of 2.69.

Here you are mixing up relative and absolute measurements. You quoted "doubling the distance cuts the intensity by four"... now how do you go from doubling the distance to "2 feet"? Or more specifically, which distance did you double?
Doubling the distance would mean to go from 1 foot to 2 or from 0.3m to 0.6m in both cases you doubled the distance and quartered the intensity...

That example only contains absolute measurements. The "doubling the distance" bit was mentioned earlier, the way I've heard photographers explain 1/d2. This example only contains absolute d values being plugged into 1/d2.

Your falloff factors are relative to a distance of 1 in each of your respective units

Ah that makes sense! So when games use code like:

output = dot(n,l) * 1/(d*d) * intensity

then intensity is the value that you want the light to have at one unit from the centre... pretty obvious once I say it, since that's what happens.

And with the blog's formula, you're not setting intensity at 1 unit, you're setting intensity at the surface of the emitter. So the two formulas are give multipliers that should be used against different initial intensity values.

I guess seeing that the above code doesn't take steradians or areas into account anywhere, we're using some kind of assumption that all of our calculations are being done for some small-steradian-subtending small-area, which is the same for every one of our pixels? So if our game uses metres for everything, our light intensity value is in "light-units per small-area-at-1m-distance"?

If you bring the light 2x closer, it will get 4 times brighter, and with it being a point there's no limit to the number of times you can do this... so:

Also notice that while moving arbitrarily close to a theoretical point light source the energy doesn't go to infinity, the energy density does..

Thanks! So even if the light emits a quantifiable pulse of 100 photons, then at the moment of emission, there's always only 100 of them... but if your receiver was at the same point, with zero area, then we'd say there was 100 photons being received in zero area, which gives us a reading of infinity photons per m2!

In games, using the above code snippet as an example, we pretty much never take the receivers area into account (except for the N.L term). If we accounted for the actual world-size of the pixels that we're shading, and the solid angles that they subtend, would this cancel out the wackyness caused by the fact that the energy density approaches infinity? i.e. in order to measure that infinite energy density, our receiver have to have zero area, so you'd end up with something that's wacky in a different way, like ? Or we'd have a rectangular receiver area with most of it having zero energy and a single point on it's surface having infinite?

this formula doesn't work when the radius of the emitter is zero, so I'm still left puzzled about how to reconcile point emitters with spherical emitters. These two variants (1/d2 and 1/(d/r+1)2) give different answers

I figured this one out myself - it is possible to reconcile the two formulas:
In the formula from the linked blog, d is the distance from the outside of the emitting sphere to the receiver, and r is the sphere's radius. We can rearrange the blog's formula like so:

Importantly, d+r is the distance from the centre to the receiver, which is what the typical 1/d2 formula uses. So if we let D=d+r, and try and find an equivalnce with the typical formula, we get:

So, our typical 1/d2 formula is actually true for a sphere with radius of 1 unit, which implies you shouldn't trust it's answers for values of D that are smaller than 1, because such a situation should be unpossible

### #1Hodgman

Posted 31 May 2013 - 09:15 PM

One measures the distance as being 2 feet, and calculates a falloff factor of 1/4.
The other measures the distance as being 0.6096m, and calculates a falloff factor of 2.69.

Here you are mixing up relative and absolute measurements. You quoted "doubling the distance cuts the intensity by four"... now how do you go from doubling the distance to "2 feet"? Or more specifically, which distance did you double?
Doubling the distance would mean to go from 1 foot to 2 or from 0.3m to 0.6m in both cases you doubled the distance and quartered the intensity...

That example only contains absolute measurements. The "doubling the distance" bit was mentioned earlier, the way I've heard photographers explain 1/d2. This example only contains absolute d values being plugged into 1/d2.

Your falloff factors are relative to a distance of 1 in each of your respective units

Ah that makes sense! So when games use code like:

output = dot(n,l) * 1/(d*d) * intensity

then intensity is the value that you want the light to have at one unit from the centre... pretty obvious once I say it, since that's what happens.

I guess seeing that the above code doesn't take steradians or areas into account anywhere, we're using some kind of assumption that all of our calculations are being done for some small-steradian-subtending small-area, which is the same for every one of our pixels? So if our game uses metres for everything, our light intensity value is in "light-units per small-area-at-1m-distance"?

If you bring the light 2x closer, it will get 4 times brighter, and with it being a point there's no limit to the number of times you can do this... so:

Also notice that while moving arbitrarily close to a theoretical point light source the energy doesn't go to infinity, the energy density does..

Thanks! So even if the light emits a quantifiable pulse of 100 photons, then at the moment of emission, there's always only 100 of them... but if your receiver was at the same point, with zero area, then we'd say there was 100 photons being received in zero area, which gives us a reading of infinity photons per m2!

In games, using the above code snippet as an example, we pretty much never take the receivers area into account (except for the N.L term). If we accounted for the actual world-size of the pixels that we're shading, and the solid angles that they subtend, would this cancel out the wackyness caused by the fact that the energy density approaches infinity? i.e. in order to measure that infinite energy density, our receiver have to have zero area, so you'd end up with something that's wacky in a different way, like ? Or we'd have a rectangular receiver area with most of it having zero energy and a single point on it's surface having infinite?

this formula doesn't work when the radius of the emitter is zero, so I'm still left puzzled about how to reconcile point emitters with spherical emitters. These two variants (1/d2 and 1/(d/r+1)2) give different answers

I figured this one out myself - it is possible to reconcile the two formulas:
In the formula from the linked blog, d is the distance from the outside of the emitting sphere to the receiver, and r is the sphere's radius. We can rearrange the blog's formula like so:

Importantly, d+r is the distance from the centre to the receiver, which is what the typical 1/d2 formula uses. So if we let D=d+r, and try and find an equivalnce with the typical formula, we get:

So, our typical 1/d2 formula is actually true for a sphere with radius of 1 unit, which implies you shouldn't trust it's answers for values of D that are smaller than 1, because such a situation should be unpossible

PARTNERS