POV-Ray : Newsgroups : povray.newusers : Newbie question about the light_source function. Server Time
29 Jul 2024 04:23:17 EDT (-0400)
  Newbie question about the light_source function. (Message 5 to 14 of 14)  
<<< Previous 4 Messages Goto Initial 10 Messages
From: Christopher James Huff
Subject: Re: Newbie question about the light_source function.
Date: 7 Nov 2003 14:37:27
Message: <cjameshuff-D6C03B.14363107112003@netplex.aussie.org>
In article <omlmqvk93bqkfmkrvg6umk9mhu3k1rm7iq@4ax.com>,
 Marie <pen### [at] myrealboxcom> wrote:

> Since I am a newbie, I don't know what I have done. So if there's something 
> really stupid that I have done, please bare with me, and please point out my 
> mistakes.

You have a lot of lights, and they are all using full-brightness colors. 
Colors are composed of 3 float values, one for each of red, green, and 
blue. Although internally their range is practically unlimited, they are 
clipped to the range [0, 1] for output. A value of 1 is full brightness, 
and going higher will not have any effect. If you have 100 green lights 
and 2 red lights, it won't matter how much more brightly lit in green 
the surface is. A point lit with < 2, 100, 0> will appear to be < 1, 1, 
0> yellow. Basically, you just need to drastically reduce the brightness 
of your lights, and probably should use distance fading as well. And you 
should seriously look at whether all those lights are necessary...it 
looks like you may be trying to make area lights.


> PS: Sorry for the cross-posting of this message. I don't know exactly which 
> newsgroup this message really belongs to.

This group (povray.newusers) is the correct group for this kind of 
question.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: gonzo
Subject: Re: Newbie question about the light_source function.
Date: 8 Nov 2003 00:57:08
Message: <3fac85b4@news.povray.org>
Christopher James Huff <cja### [at] earthlinknet> wrote in message
news:cja### [at] netplexaussieorg...
> Colors are composed of 3 float values, one for each of red, green, and
> blue. Although internally their range is practically unlimited, they are
> clipped to the range [0, 1] for output. A value of 1 is full brightness,
> and going higher will not have any effect. If you have 100 green lights
> and 2 red lights, it won't matter how much more brightly lit in green
> the surface is. A point lit with < 2, 100, 0> will appear to be < 1, 1,
> 0> yellow.

That's the best explanation I've seen yet of light_ source output, thank
you.  My question is, what does fade_power do?

If I have a light_source with <7.5,5,1> it's output is white,  however using
a light_source of <.75,.5,.1> with a fade_power of 10 & fade_distance >
distance_to_camera, it's output still looks amber.

RG


Post a reply to this message

From: Christopher James Huff
Subject: Re: Newbie question about the light_source function.
Date: 8 Nov 2003 10:28:30
Message: <cjameshuff-988605.10271708112003@netplex.aussie.org>
In article <3fac85b4@news.povray.org>, "gonzo" <rgo### [at] lansetcom> wrote:

> That's the best explanation I've seen yet of light_ source output, thank
> you.  My question is, what does fade_power do?
> 
> If I have a light_source with <7.5,5,1> it's output is white,  however using
> a light_source of <.75,.5,.1> with a fade_power of 10 & fade_distance >
> distance_to_camera, it's output still looks amber.

Your < 7.5, 5, 1> light source only *looks* white when shining on a 
surface where the reflected color is >= < 1, 1, 1>. Internally, it is 
really < 7.5, 5, 1>, and avery dark surface, thick media, or other 
circumstances can give visible effects from these high light 
intensities. Distance fading is pretty self-explanatory: it makes the 
light fade with distance.
http://povray.org/documentation/view/172/#s06_05_07_09

So with a fade_distance of 1 and fade_power 2, the light intensity from 
your < 7.5, 5, 1> light source at a distance of 5 units will be:
< 0.576923077, 0.384615385, 0.0769230769>

A fade_power of 2 is most realistic (approximating the inverse-square 
law), 10 doesn't correspond to any real-world effect. And fade_distance 
is just used to control the falloff rate, it has nothing to do with the 
camera position. It is really the same as adjusting the brightness of 
the light, though it is not implemented that way internally. The 
distance given to fade_distance is the distance where the light is at 
the specified brightness, it decreases with distance from there, and 
increases as the distance drops below fade_distance. (the documentation 
appears to be slightly incorrect about this: only the ratio of 
distance/fade_distance matters, not the size of fade_distance in 
relation to 1)

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: gonzo
Subject: Re: Newbie question about the light_source function.
Date: 9 Nov 2003 03:39:28
Message: <3fadfd40@news.povray.org>
Christopher James Huff <cja### [at] earthlinknet> wrote in message
news:cja### [at] netplexaussieorg...
> Your < 7.5, 5, 1> light source only *looks* white when shining on a
> surface where the reflected color is >= < 1, 1, 1>. Internally, it is
> really < 7.5, 5, 1>, and avery dark surface, thick media, or other
> circumstances can give visible effects from these high light
> intensities.

Ah, so reflection (and probably specular or phong) will still see it
correctly as long it's <1. That's probably what I'm seeing.
>
> So with a fade_distance of 1 and fade_power 2, the light intensity from
> your < 7.5, 5, 1> light source at a distance of 5 units will be:
> < 0.576923077, 0.384615385, 0.0769230769>

It's distances less than fade_distance I'm most interested in.

> A fade_power of 2 is most realistic (approximating the inverse-square
> law), 10 doesn't correspond to any real-world effect.

That's the beauty of being utterly ignorant of real world mathmatics... I
can just do weird stuff without worrying about whether it's realistic or not
;-)

And fade_distance
> is just used to control the falloff rate, it has nothing to do with the
> camera position.

Oops, actually, I meant the distance between light_source & object, not
light_source & camera...

The
> distance given to fade_distance is the distance where the light is at
> the specified brightness, it decreases with distance from there, and
> increases as the distance drops below fade_distance. (the documentation
> appears to be slightly incorrect about this: only the ratio of
> distance/fade_distance matters, not the size of fade_distance in
> relation to 1)

Ok, that was confusing me too.

The main reason I use high fade_power is to simulate sunlight which is
waaaay bright, but seldom pure white. So I set the color I want the light to
be then boost fade_power way up.

An example is my Old Technology IRTC entry
(http://www.irtc.org/ftp/pub/stills/2003-02-28/async_rg.jpg) where I'm using
fade_power 7, fade_distance 1000 so everything in the scene is within the
fade_distance.  But I'm using scattering media atmosphere, and as you say
above, that can still use the higher intensity.  And looking at it now, the
color is most noticable where there is reflection or specular highlights.
And it does say in the docs that reflected or refracted light is not
attenuated, so I guess that explains it.

Thanks for the explanation.  So, ok, it doesn't work the way I thought it
did, but as long as it works...

RG


Post a reply to this message

From: Marc Jacquier
Subject: Re: Newbie question about the light_source function.
Date: 9 Nov 2003 05:23:26
Message: <3fae159e$1@news.povray.org>

3fadfd40@news.povray.org...
>
> The main reason I use high fade_power is to simulate sunlight which is
> waaaay bright, but seldom pure white. So I set the color I want the light
to
> be then boost fade_power way up.
>
you could mutliply your light color definition, say <1, 0.9, 0.8>*2, rather
using fade_power.
high fade_power is very unrealistic for the sun except if you translate it
far away because real sun is so far from earth that  scene distances are
very small relatively to sun distance.
We do not notice any sunlight fading due to distance on earth.

Marc


Post a reply to this message

From: Christopher James Huff
Subject: Re: Newbie question about the light_source function.
Date: 9 Nov 2003 10:38:13
Message: <cjameshuff-73E452.10364609112003@netplex.aussie.org>
In article <3fadfd40@news.povray.org>, "gonzo" <rgo### [at] lansetcom> wrote:

> Ah, so reflection (and probably specular or phong) will still see it
> correctly as long it's <1. That's probably what I'm seeing.

Reflection and other features will see it correctly no matter what the 
brightness is. Anything brighter than 1 will be clipped to 1 when the 
image is written to a file. If you make a very dark filter and put it in 
front of the camera, you will see the shading that you couldn't before.


> > So with a fade_distance of 1 and fade_power 2, the light intensity from
> > your < 7.5, 5, 1> light source at a distance of 5 units will be:
> > < 0.576923077, 0.384615385, 0.0769230769>
> 
> It's distances less than fade_distance I'm most interested in.

Those get brighter, up to 2x brighter than the specified light source 
brightness.


> The main reason I use high fade_power is to simulate sunlight which is
> waaaay bright, but seldom pure white.

This is highly inaccurate. At the distance of Earth's orbit, sunlight is 
essentially constant over any planetary distances. The sun is 
practically as bright on the moon as in near earth orbit, no matter what 
their relative positions are. You certainly aren't going to see any 
difference at smaller scales.
Light fading is only useful for situations where you are close to the 
source of the light or can see objects that have widely varying 
distances from the light.


> So I set the color I want the light to
> be then boost fade_power way up.

And this is the wrong way to adjust brightness...you should adjust 
fade_distance instead. BTW, I've done some more testing, and fade_power 
3 actually approximates inverse-square falloff more closely, at least as 
long as distance > fade_distance.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Matthew Pace
Subject: Re: Newbie question about the light_source function.
Date: 9 Nov 2003 22:06:30
Message: <matt-pace-2FB775.19062909112003@netplex.aussie.org>
In article <cja### [at] netplexaussieorg>,
 Christopher James Huff <cja### [at] earthlinknet> wrote:
> You have a lot of lights, and they are all using full-brightness colors. 
> Colors are composed of 3 float values, one for each of red, green, and 
> blue. Although internally their range is practically unlimited, they are 
> clipped to the range [0, 1] for output. A value of 1 is full brightness, 
> and going higher will not have any effect. If you have 100 green lights 
> and 2 red lights, it won't matter how much more brightly lit in green 
> the surface is. A point lit with < 2, 100, 0> will appear to be < 1, 1, 
> 0> yellow. Basically, you just need to drastically reduce the brightness 
> of your lights, and probably should use distance fading as well. And you 
> should seriously look at whether all those lights are necessary...it 
> looks like you may be trying to make area lights.


I thought that I read somewhere that a light defined as color rgb 2 
would be white, but twice as bright as normal.  Is this true?  Did 
anyone else read this? Am I insane?  I didnt think this was possible, as 
the light could only get so bright, but please put my doubts to rest.

Thanks


Post a reply to this message

From: Christopher James Huff
Subject: Re: Newbie question about the light_source function.
Date: 9 Nov 2003 22:59:29
Message: <cjameshuff-9A71BA.22580509112003@netplex.aussie.org>
In article <mat### [at] netplexaussieorg>,
 Matthew Pace <mat### [at] lycoscom> wrote:

> I thought that I read somewhere that a light defined as color rgb 2 
> would be white, but twice as bright as normal.  Is this true?  Did 
> anyone else read this? Am I insane?  I didnt think this was possible, as 
> the light could only get so bright, but please put my doubts to rest.

Well, I pretty much just said so, though not using that specific 
example. It is white and twice as bright as rgb < 1, 1, 1>. Your monitor 
can only display colors with a limitedd range of brightness and most 
file formats only store percentages of maximum brightness rather than 
absolute brightness, so the colors are clipped at output. There is no 
difference in the final output between a color that the camera saw as < 
2, 7, 1> and one that was only < 1, 1, 1>.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Marc Jacquier
Subject: Re: Newbie question about the light_source function.
Date: 10 Nov 2003 03:34:02
Message: <3faf4d7a$1@news.povray.org>

de news: cja### [at] netplexaussieorg...
Your monitor
> can only display colors with a limitedd range of brightness and most
> file formats only store percentages of maximum brightness rather than
> absolute brightness, so the colors are clipped at output.
But pixels colors are computed from light color>fade due to distance>object
pigment/diffuse properties... so not inevitably clipped.
If you want maximum dynamic range in your image (i.e white highlights and
black most dark shadows) you can multiply your light color.

Marc


Post a reply to this message

From: Christopher James Huff
Subject: Re: Newbie question about the light_source function.
Date: 10 Nov 2003 08:47:07
Message: <cjameshuff-48A936.08454510112003@netplex.aussie.org>
In article <3faf4d7a$1@news.povray.org>,
 "Marc Jacquier" <jac### [at] wanadoofr> wrote:

> Your monitor
> > can only display colors with a limitedd range of brightness and most
> > file formats only store percentages of maximum brightness rather than
> > absolute brightness, so the colors are clipped at output.
> But pixels colors are computed from light color>fade due to distance>object
> pigment/diffuse properties... so not inevitably clipped.

Distance fading is off by default and scenes usually have at least some 
pigment/diffuse properties that come close to white.


> If you want maximum dynamic range in your image (i.e white highlights and
> black most dark shadows) you can multiply your light color.

By what?
Yes, you can pack more information into the output image by making sure 
the lighting is dark enough that clipping is minimized, and then 
post-processing the scene to get the normally lit portions (which are 
now very dark because of the light scaling) to show up right. However, 
this has bad precision effects...a 24-bit image has 8 bits per color 
component. That's 256 levels from black to 100% intensity. If you use 
100% to mean 2x max viewable intensity, you've just limited the normal 
[0, 1] range of lighting to 128 levels of intensity. If 100% means 10x 
max viewable intensity, you limit it to 25 levels.

You could render multiple images at different color scales and combine 
their data, but your best bet is to just use a patch that adds a high 
dynamic range output format.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

<<< Previous 4 Messages Goto Initial 10 Messages

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.