Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

Brightness of light from distance (Real Studio games Mailinglist archive)

Back to the thread list
Previous thread: Re: Brightness of light (limitation)
Next thread: [ANN] Animation Builder Alpha 2 for RB3D


[ANN] Preview of RBD 2.4   -   Marc Zeedar
  Brightness of light from distance   -   Lo Saeteurn
   Re: Brightness of light from distance   -   Frank Condello
   Re: Brightness of light from distance   -   Lo Saeteurn
   Re: Brightness of light from distance   -   William Squires
   Re: Brightness of light from distance   -   Lo Saeteurn
    Re: Brightness of light from distance   -   Lars Jensen
     Re: Brightness of light from distance   -   Frank Condello
     Re: Brightness of light from distance   -   Chris Dillman
     Re: Brightness of light from distance   -   Frank Condello
     Re: Brightness of light from distance   -   Chris Dillman
     Re: Brightness of light from distance   -   Frank Condello
     Re: Light Limitation   -   Frank Condello
   Re: Brightness of light from distance   -   Frank Condello

Brightness of light from distance
Date: 22.07.05 08:47 (Fri, 22 Jul 2005 00:47:38 -0700)
From: Lo Saeteurn
Hi,

Do anyone know how find how bright a point light is from a certain
distance (both linear and squared)?

Ex: If I'm 15 units away from a point light that has 500 brightness,
how bright would it be (both linear and squared attenuation)?

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Brightness of light from distance
Date: 22.07.05 18:06 (Fri, 22 Jul 2005 13:06:55 -0400)
From: Frank Condello
On 22-Jul-05, at 3:47 AM, Lo Saeteurn wrote:

> Do anyone know how find how bright a point light is from a certain
> distance (both linear and squared)?

Quesa (quite reasonably) uses a simplified GL light model, so the
attenuation factor in Quesa will always be:

LinearAttenuationFactor = 1.0 / Distance
QuadraticAttenuationFactor = 1.0 / Distance^2

The attenuation factor is applied to the RGB component (which is used
for both the diffuse and specular term, simplifying things again).
The RGB component is also scaled by a brightness value, but you also
have to take into account the luminance of the light's colour. To get
a normalized luminance value from an RB Color type, you can use the
following:

Luminance = (R/255)*0.30 + (G/255)*0.59 + (B/255)*0.11

So if my head's screwed on right the brightness at a given distance
from a light should be:

Brightness = (Luminance*(light.Brightness/100)) * AttenuationFactor

You'll have to add the contribution for every light that reaches that
point, and you might also need to consider constant luminance from
directional lights, and the global ambient term.

Frank.
–––––––––––––––––––––––––––––––––
Open Source RB Goodies and Shareware
<http://developer.chaoticbox.com/>
<http://www.chaoticbox.com/>
–––––––––––––––––––––––––––––––––

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Brightness of light from distance
Date: 22.07.05 20:35 (Fri, 22 Jul 2005 12:35:32 -0700)
From: Lo Saeteurn
Thanks! I will try that.

On Jul 22, 2005, at 10:06 AM, Frank Condello wrote:

> On 22-Jul-05, at 3:47 AM, Lo Saeteurn wrote:
>
>> Do anyone know how find how bright a point light is from a certain
>> distance (both linear and squared)?
>>
> Quesa (quite reasonably) uses a simplified GL light model, so the
> attenuation factor in Quesa will always be:
>
> LinearAttenuationFactor = 1.0 / Distance
> QuadraticAttenuationFactor = 1.0 / Distance^2
>
> The attenuation factor is applied to the RGB component (which is
> used for both the diffuse and specular term, simplifying things
> again). The RGB component is also scaled by a brightness value, but
> you also have to take into account the luminance of the light's
> colour. To get a normalized luminance value from an RB Color type,
> you can use the following:
>
> Luminance = (R/255)*0.30 + (G/255)*0.59 + (B/255)*0.11
>
> So if my head's screwed on right the brightness at a given distance
> from a light should be:
>
> Brightness = (Luminance*(light.Brightness/100)) *
> AttenuationFactor
>
> You'll have to add the contribution for every light that reaches
> that point, and you might also need to consider constant luminance
> from directional lights, and the global ambient term.
>
> Frank.
> –––––––––––––––––––––––––––––––––
> Open Source RB Goodies and Shareware
> <http://developer.chaoticbox.com/>
> <http://www.chaoticbox.com/>
> –––––––––––––––––––––––––––––––––
>
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
> Search the archives of this list here:
> <http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Brightness of light from distance
Date: 23.07.05 01:17 (Fri, 22 Jul 2005 19:17:05 -0500)
From: William Squires
On Jul 22, 2005, at 2:47 AM, Lo Saeteurn wrote:

> Hi,
>
> Do anyone know how find how bright a point light is from a certain
> distance (both linear and squared)?
>
> Ex: If I'm 15 units away from a point light that has 500 brightness,
> how bright would it be (both linear and squared attenuation)?
>
Actual light - or any radiation in the electromagnetic spectrum -
drops by the square of the distance, so:

I = P * (i / (d ^ 2))

where 'I' is the intensity 'd' units away from the point source, and
'i' is - I believe - the stated intensity in candlepower at the source,
and P is a proportionality constant to take into account other factors,
such as the sensitivity of the sensor, dust in the air, etc...
So, plugging in, you'd get:

I = (500) / (15 ^ 2) = 2.22 units of intensity (brightness). (ignoring
'P'; i.e. 'P' = 1)

Keep in mind that the perceived intensity may be less than this
number, depending on the sensitivity of the sensor to the wavelength(s)
in question, in which case, 'P' < 1!
Also, note that it doesn't apply to lasers/masers because of the
extreme directionality of the emitted radiation.
If it fell off as a straight linear function, then just remove the '^
2' from the equation, in which case, you'd get

I = P * (i / d)

or - again ignoring P -

I = (500 / 15)
I = 33.3 units of intensity

> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
> Search the archives of this list here:
> <http://support.realsoftware.com/listarchives/lists.html>
William H Squires Jr
<email address removed>am <- remove the .nospam

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Brightness of light from distance
Date: 23.07.05 05:07 (Fri, 22 Jul 2005 21:07:23 -0700)
From: Lo Saeteurn
Is the accurate to what a user views in a game?

Which method should I use? What's the difference between yours and
Frank's?

On Jul 22, 2005, at 5:17 PM, William Squires wrote:

> On Jul 22, 2005, at 2:47 AM, Lo Saeteurn wrote:
>
>> Hi,
>>
>> Do anyone know how find how bright a point light is from a certain
>> distance (both linear and squared)?
>>
>> Ex: If I'm 15 units away from a point light that has 500
>> brightness, how bright would it be (both linear and squared
>> attenuation)?
>>
> Actual light - or any radiation in the electromagnetic spectrum -
> drops by the square of the distance, so:
>
> I = P * (i / (d ^ 2))
>
> where 'I' is the intensity 'd' units away from the point source,
> and 'i' is - I believe - the stated intensity in candlepower at the
> source, and P is a proportionality constant to take into account
> other factors, such as the sensitivity of the sensor, dust in the
> air, etc...
> So, plugging in, you'd get:
>
> I = (500) / (15 ^ 2) = 2.22 units of intensity (brightness).
> (ignoring 'P'; i.e. 'P' = 1)
>
> Keep in mind that the perceived intensity may be less than this
> number, depending on the sensitivity of the sensor to the wavelength
> (s) in question, in which case, 'P' < 1!
> Also, note that it doesn't apply to lasers/masers because of the
> extreme directionality of the emitted radiation.
> If it fell off as a straight linear function, then just remove
> the '^ 2' from the equation, in which case, you'd get
>
> I = P * (i / d)
>
> or - again ignoring P -
>
> I = (500 / 15)
> I = 33.3 units of intensity
>
>> _______________________________________________
>> Unsubscribe or switch delivery mode:
>> <http://www.realsoftware.com/support/listmanager/>
>>
>> Search the archives of this list here:
>> <http://support.realsoftware.com/listarchives/lists.html>
>>
> William H Squires Jr
> <email address removed>am <- remove the .nospam
>
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
> Search the archives of this list here:
> <http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Brightness of light from distance
Date: 23.07.05 14:21 (Sat, 23 Jul 2005 09:21:48 -0400)
From: Lars Jensen
I thought I read somewhere that Quesa cuts off illumination after a certain
distance or below a certain threshold or something. But that might just be
me on drugs.

lj
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Brightness of light from distance
Date: 23.07.05 20:10 (Sat, 23 Jul 2005 15:10:28 -0400)
From: Frank Condello
On 23-Jul-05, at 9:21 AM, Lars Jensen wrote:

> I thought I read somewhere that Quesa cuts off illumination after a
> certain
> distance or below a certain threshold or something. But that might
> just be
> me on drugs.

It may have in the past but that doesn't appear to be the case in the
current release. The interactive renderer scales the light colour by
the brightness and sends that to OpenGL. Lights brighter than 100%
are simply over-saturated.

Frank.
–––––––––––––––––––––––––––––––––
Open Source RB Goodies and Shareware
<http://developer.chaoticbox.com/>
<http://www.chaoticbox.com/>
–––––––––––––––––––––––––––––––––

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Brightness of light from distance
Date: 23.07.05 23:15 (Sat, 23 Jul 2005 17:15:01 -0500)
From: Chris Dillman
>On 23-Jul-05, at 9:21 AM, Lars Jensen wrote:
>
>>I thought I read somewhere that Quesa cuts off illumination after a certain
>>distance or below a certain threshold or something. But that might just be
>>me on drugs.
>
>It may have in the past but that doesn't appear to be the case in
>the current release. The interactive renderer scales the light
>colour by the brightness and sends that to OpenGL. Lights brighter
>than 100% are simply over-saturated.

Hey frank can normal GL lights over saturated textures etc?
Making them go towards the umm bright white instead of fully lit?

Cause I have been wondering how some engines do that.

Re: Brightness of light from distance
Date: 24.07.05 00:01 (Sat, 23 Jul 2005 19:01:02 -0400)
From: Frank Condello
On 23-Jul-05, at 6:15 PM, Chris Dillman wrote:

>> On 23-Jul-05, at 9:21 AM, Lars Jensen wrote:
>>
>>> I thought I read somewhere that Quesa cuts off illumination after
>>> a certain
>>> distance or below a certain threshold or something. But that
>>> might just be
>>> me on drugs.
>>
>> It may have in the past but that doesn't appear to be the case in
>> the current release. The interactive renderer scales the light
>> colour by the brightness and sends that to OpenGL. Lights brighter
>> than 100% are simply over-saturated.
>
> Hey frank can normal GL lights over saturated textures etc?
> Making them go towards the umm bright white instead of fully lit?
>
> Cause I have been wondering how some engines do that.

Depends on the effect you're looking for...

Using GL_EXT_separate_specular_color you can add a specular highlight
after the texture in a single pass, which in effect saturates the
texture, but you can fake it with a separate specular pass that uses
additive blending. You can also do lighting entirely as a separate
pass using a blendfunc of (GL_DST_COLOR, GL_SRC_COLOR) which will
brighten/saturate light values and filter dark values. This should be
possible in one pass with multitexture/combiners as well.

Frank.
–––––––––––––––––––––––––––––––––
Open Source RB Goodies and Shareware
<http://developer.chaoticbox.com/>
<http://www.chaoticbox.com/>
–––––––––––––––––––––––––––––––––

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Brightness of light from distance
Date: 24.07.05 00:40 (Sat, 23 Jul 2005 18:40:12 -0500)
From: Chris Dillman
>On 23-Jul-05, at 6:15 PM, Chris Dillman wrote:
>
>>>On 23-Jul-05, at 9:21 AM, Lars Jensen wrote:
>>>
>>>>I thought I read somewhere that Quesa cuts off illumination after a certain
>>>>distance or below a certain threshold or something. But that might just be
>>>>me on drugs.
>>>
>>>It may have in the past but that doesn't appear to be the case in
>>>the current release. The interactive renderer scales the light
>>>colour by the brightness and sends that to OpenGL. Lights brighter
>>>than 100% are simply over-saturated.
>>
>>Hey frank can normal GL lights over saturated textures etc?
>>Making them go towards the umm bright white instead of fully lit?
>>
>>Cause I have been wondering how some engines do that.
>
>Depends on the effect you're looking for...
>
>Using GL_EXT_separate_specular_color you can add a specular
>highlight after the texture in a single pass, which in effect
>saturates the texture, but you can fake it with a separate specular
>pass that uses additive blending. You can also do lighting entirely
>as a separate pass using a blendfunc of (GL_DST_COLOR, GL_SRC_COLOR)
>which will brighten/saturate light values and filter dark values.
>This should be possible in one pass with multitexture/combiners as
>well.

Any clue on how one might do it using vertex coloring?
If say your doing your own lighting and ending it to GL.

Re: Brightness of light from distance
Date: 24.07.05 01:02 (Sat, 23 Jul 2005 20:02:53 -0400)
From: Frank Condello
On 23-Jul-05, at 7:40 PM, Chris Dillman wrote:
>>>
>>> Hey frank can normal GL lights over saturated textures etc?
>>> Making them go towards the umm bright white instead of fully lit?
>>
>> Depends on the effect you're looking for...
>>
>> Using GL_EXT_separate_specular_color you can add a specular
>> highlight after the texture in a single pass, which in effect
>> saturates the texture, but you can fake it with a separate
>> specular pass that uses additive blending. You can also do
>> lighting entirely as a separate pass using a blendfunc of
>> (GL_DST_COLOR, GL_SRC_COLOR) which will brighten/saturate light
>> values and filter dark values. This should be possible in one pass
>> with multitexture/combiners as well.
>
> Any clue on how one might do it using vertex coloring?

GL_EXT_separate_specular_color won't work in that case but two passes/
combiners should work just fine - just turn off texturing for the
lighting pass.

Frank.
–––––––––––––––––––––––––––––––––
Open Source RB Goodies and Shareware
<http://developer.chaoticbox.com/>
<http://www.chaoticbox.com/>
–––––––––––––––––––––––––––––––––

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Brightness of light from distance
Date: 23.07.05 19:56 (Sat, 23 Jul 2005 14:56:51 -0400)
From: Frank Condello
On 23-Jul-05, at 12:07 AM, Lo Saeteurn wrote:

> Is the accurate to what a user views in a game?
>
> Which method should I use? What's the difference between yours and
> Frank's?

I described how Quesa actually lights a scene, and how to find the
maximum luminance for a point at a certain distance from a light (I
assumed you wanted to know how to find the brightness in an Rb3D
scene). NOTE: What I posted won't find the actual brightness of a
given point, only how a vertex at that exact position with a normal
pointing directly at the light will be lit. That's usually what you
want if you're just testing if an object is potentially lit or not
(e.g. for an AI routine that determines object visibility base on
light levels). Finding what the actual rasterized pixel luminance
would be is a lot more work...

Will described a general case, which won't be of much practical use
unless you're doing your own lighting based on those formulas.

Frank.
–––––––––––––––––––––––––––––––––
Open Source RB Goodies and Shareware
<http://developer.chaoticbox.com/>
<http://www.chaoticbox.com/>
–––––––––––––––––––––––––––––––––

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>