![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Hello,
I am trying to figure out, the way POV handles ambient light. As far as
I know, an oversimplified
formula to compute the light in a surface, can be given by
I = Ia + Id + Is + ...
where Ia = ambient light, Id = diffuse light, Is = specular light etc.
The problem is that POV does not seem to use that formula. Specifically,
instead of just adding the
ambient term to the total, it multiplies each R,G,B coefficient with the
color pigment. The code is in
lighting.c, #2504, in function compute_lighted_texture
/* Add ambient contribution. */
TmpCol[0] += Att * LayCol[0] * Layer->Finish->Ambient[0] *
Frame.Ambient_Light[0] * AmbCol[0]);
TmpCol[1] += Att * LayCol[1] * Layer->Finish->Ambient[1] *
Frame.Ambient_Light[1] * AmbCol[1]);
TmpCol[2] += Att * LayCol[2] * Layer->Finish->Ambient[2] *
Frame.Ambient_Light[2] * AmbCol[2]);
Thus, there seems to be no way, to have for example a red colored shape,
with green ambient light:
// Sphere object
sphere { <0, 3, 0>, 3
pigment { color rgb<1,0,0> }
finish {
ambient <0,1,0>
diffuse 0.7
phong 1
phong_size 80
brilliance 2
}
}
All that this does, is that it produces a red sphere with NO AMBIENT light!
I would appreciate any suggestions. Thanks for your time!
Regards,
Elias Hatzigeorgiou.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
No, this is exactly how "nature works". If you have a pure
red ball (1,0,0) and pure green light (0,1,0) shining upon
it the ball will look black.
-Hans-
EliasH wrote:
>
> Hello,
> I am trying to figure out, the way POV handles ambient light. As far as
> I know, an oversimplified
> formula to compute the light in a surface, can be given by
>
> I = Ia + Id + Is + ...
>
> where Ia = ambient light, Id = diffuse light, Is = specular light etc.
>
> The problem is that POV does not seem to use that formula. Specifically,
> instead of just adding the
> ambient term to the total, it multiplies each R,G,B coefficient with the
> color pigment. The code is in
> lighting.c, #2504, in function compute_lighted_texture
>
> /* Add ambient contribution. */
> TmpCol[0] += Att * LayCol[0] * Layer->Finish->Ambient[0] *
> Frame.Ambient_Light[0] * AmbCol[0]);
> TmpCol[1] += Att * LayCol[1] * Layer->Finish->Ambient[1] *
> Frame.Ambient_Light[1] * AmbCol[1]);
> TmpCol[2] += Att * LayCol[2] * Layer->Finish->Ambient[2] *
> Frame.Ambient_Light[2] * AmbCol[2]);
>
> Thus, there seems to be no way, to have for example a red colored shape,
> with green ambient light:
>
> // Sphere object
> sphere { <0, 3, 0>, 3
> pigment { color rgb<1,0,0> }
> finish {
> ambient <0,1,0>
> diffuse 0.7
> phong 1
> phong_size 80
> brilliance 2
> }
> }
>
> All that this does, is that it produces a red sphere with NO AMBIENT light!
>
> I would appreciate any suggestions. Thanks for your time!
>
> Regards,
> Elias Hatzigeorgiou.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In chapter 3 of Watt's "3D Computer Graphics" [1], you can find a simple
lighting model, that consists of ambient, diffuse and
specular highlights. Watt comments that a very simple means to control the
color of an object
is via the ambient and diffuse coefficients.
That is
I = (Ia_red,Ia_green,Ia_blue) + (Id_red,Id_green,Id_blue) *N.L + Is
where Ia = ambient light, Id = diffuse light, Is = specular light.
[1] A. Watt, 3D Computer Graphics, Second Edition, Addison-Wesley,
Wokingham, England, 1993, Chapter3.
---------
"Hans-Detlev Fink" Wrote :
> No, this is exactly how "nature works". If you have a pure
> red ball (1,0,0) and pure green light (0,1,0) shining upon
> it the ball will look black.
>
> -Hans-
>
> --------------------------EliasH wrote:
> >
> > Hello,
> > I am trying to figure out, the way POV handles ambient light. As far
as
> > I know, an oversimplified
> > formula to compute the light in a surface, can be given by
> >
> > I = Ia + Id + Is + ...
> >
> > where Ia = ambient light, Id = diffuse light, Is = specular light etc.
> >
> > The problem is that POV does not seem to use that formula. Specifically,
> > instead of just adding the
> > ambient term to the total, it multiplies each R,G,B coefficient with the
> > color pigment. The code is in
> > lighting.c, #2504, in function compute_lighted_texture
> >
> > /* Add ambient contribution. */
> > TmpCol[0] += Att * LayCol[0] * Layer->Finish->Ambient[0] *
> > Frame.Ambient_Light[0] * AmbCol[0]);
> > TmpCol[1] += Att * LayCol[1] * Layer->Finish->Ambient[1] *
> > Frame.Ambient_Light[1] * AmbCol[1]);
> > TmpCol[2] += Att * LayCol[2] * Layer->Finish->Ambient[2] *
> > Frame.Ambient_Light[2] * AmbCol[2]);
> >
> > Thus, there seems to be no way, to have for example a red colored shape,
> > with green ambient light:
> >
> > // Sphere object
> > sphere { <0, 3, 0>, 3
> > pigment { color rgb<1,0,0> }
> > finish {
> > ambient <0,1,0>
> > diffuse 0.7
> > phong 1
> > phong_size 80
> > brilliance 2
> > }
> > }
> >
> > All that this does, is that it produces a red sphere with NO AMBIENT
light!
> >
> > I would appreciate any suggestions. Thanks for your time!
> >
> > Regards,
> > Elias Hatzigeorgiou.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Hans-Detlev Fink <hdf### [at] pec os de> wrote:
: No, this is exactly how "nature works". If you have a pure
: red ball (1,0,0) and pure green light (0,1,0) shining upon
: it the ball will look black.
Not exactly. In most objects there's a specular reflection of the light
from the object surface which will make a light source colored spot.
--
char*i="b[7FK@`3NB6>B:b3O6>:B:b3O6><`3:;8:6f733:>::b?7B>:>^B>C73;S1";
main(_,c,m){for(m=32;c=*i++-49;c&m?puts(""):m)for(_=(
c/4)&7;putchar(m),_--?m:(_=(1<<(c&3))-1,(m^=3)&3););} /*- Warp -*/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Warp wrote:
>
> Not exactly. In most objects there's a specular reflection of the light
> from the object surface which will make a light source colored spot.
>
As I see it, if the surface is to reflect only pure red, then by definition
there should be no reflection (diffuse or specular) of green light. But of
course the default specular highlight model in POV works differently.
--
Margus Ramst
Personal e-mail: mar### [at] peak edu ee
TAG (Team Assistance Group) e-mail: mar### [at] tag povray org
Home page http://www.hot.ee/margusrt
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Margus Ramst <mar### [at] peak edu ee> wrote:
: As I see it, if the surface is to reflect only pure red, then by definition
: there should be no reflection (diffuse or specular) of green light. But of
: course the default specular highlight model in POV works differently.
In nature materials are not perfect. They do not "reflect only pure red".
This is easier to figure out with black objects. In theory, a black object
should not reflect ANY light. However, have you ever seen a black object
without even the slightest highlight and shadow? Even the blackest object
always reflect some light and that's why you see the shape of the object
and not only its silhouette.
If even black objects reflect some light, then non-black objects reflect
even more easily.
--
char*i="b[7FK@`3NB6>B:b3O6>:B:b3O6><`3:;8:6f733:>::b?7B>:>^B>C73;S1";
main(_,c,m){for(m=32;c=*i++-49;c&m?puts(""):m)for(_=(
c/4)&7;putchar(m),_--?m:(_=(1<<(c&3))-1,(m^=3)&3););} /*- Warp -*/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Warp" <war### [at] tag povray org> wrote in message
news:3a7938ef@news.povray.org...
>
> This is easier to figure out with black objects. In theory, a black
object
> should not reflect ANY light. However, have you ever seen a black object
> without even the slightest highlight and shadow? Even the blackest object
> always reflect some light and that's why you see the shape of the object
> and not only its silhouette.
> If even black objects reflect some light, then non-black objects reflect
> even more easily.
IIRC AC.Clarke emphasises the other-worldliness of the monolith by giving it
the property of pure black.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Warp wrote:
>
> Margus Ramst <mar### [at] peak edu ee> wrote:
> : As I see it, if the surface is to reflect only pure red, then by definition
> : there should be no reflection (diffuse or specular) of green light. But of
> : course the default specular highlight model in POV works differently.
>
> In nature materials are not perfect. They do not "reflect only pure red".
>
> This is easier to figure out with black objects. In theory, a black object
> should not reflect ANY light. However, have you ever seen a black object
> without even the slightest highlight and shadow? Even the blackest object
> always reflect some light and that's why you see the shape of the object
> and not only its silhouette.
True. But then these objects are not really black in terms of
the physical model we chose. And similarly, the pure red ball is
a theoretical monster, only found in otherworlds.
-Hans-
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Hans-Detlev Fink" <hdf### [at] pec os de> wrote in message
news:3A79860F.B5E9A568@pec.os.de...
<SNIP>
Isn't this a slightly circular arguement? A pure black object is pure black
because it doesn't reflect any light. It's not that a black object doesn't
reflect any light, it's that an object that doesn't reflect any light
appears black. The colour is the result, not the cause. I'll shut up know.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Right. And we'll have to set our physical/renderer
parameters such that reality is "reflected" best.
Will now shut up, too. ;)
Tom Melly wrote:
>
> "Hans-Detlev Fink" <hdf### [at] pec os de> wrote in message
> news:3A79860F.B5E9A568@pec.os.de...
>
> <SNIP>
>
> Isn't this a slightly circular arguement? A pure black object is pure black
> because it doesn't reflect any light. It's not that a black object doesn't
> reflect any light, it's that an object that doesn't reflect any light
> appears black. The colour is the result, not the cause. I'll shut up know.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |