POV-Ray : Newsgroups : povray.unofficial.patches : ambient light handling Server Time
1 Sep 2024 18:13:10 EDT (-0400)
  ambient light handling (Message 1 to 10 of 10)  
From: EliasH
Subject: ambient light handling
Date: 31 Jan 2001 08:39:09
Message: <3a78157d@news.povray.org>
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

From: Hans-Detlev Fink
Subject: Re: ambient light handling
Date: 31 Jan 2001 08:57:17
Message: <3A7819E3.39194A18@pec.os.de>
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

From: EliasH
Subject: Re: ambient light handling
Date: 31 Jan 2001 09:56:01
Message: <3a782781@news.povray.org>
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

From: Warp
Subject: Re: ambient light handling
Date: 31 Jan 2001 11:22:57
Message: <3a783bdf@news.povray.org>
Hans-Detlev Fink <hdf### [at] pecosde> 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

From: Margus Ramst
Subject: Re: ambient light handling
Date: 31 Jan 2001 18:46:47
Message: <3A78A46E.DB013BCA@peak.edu.ee>
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] peakeduee
TAG (Team Assistance Group) e-mail: mar### [at] tagpovrayorg
Home page http://www.hot.ee/margusrt


Post a reply to this message

From: Warp
Subject: Re: ambient light handling
Date: 1 Feb 2001 05:22:39
Message: <3a7938ef@news.povray.org>
Margus Ramst <mar### [at] peakeduee> 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

From: Tom Melly
Subject: Re: ambient light handling
Date: 1 Feb 2001 09:59:04
Message: <3a7979b8$1@news.povray.org>
"Warp" <war### [at] tagpovrayorg> 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

From: Hans-Detlev Fink
Subject: Re: ambient light handling
Date: 1 Feb 2001 10:51:09
Message: <3A79860F.B5E9A568@pec.os.de>
Warp wrote:
> 
> Margus Ramst <mar### [at] peakeduee> 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

From: Tom Melly
Subject: Re: ambient light handling
Date: 1 Feb 2001 11:20:47
Message: <3a798cdf$1@news.povray.org>
"Hans-Detlev Fink" <hdf### [at] pecosde> 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

From: Hans-Detlev Fink
Subject: Re: ambient light handling
Date: 2 Feb 2001 06:44:17
Message: <3A7A9DB0.D5EE1DE4@pec.os.de>
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] pecosde> 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

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