|
![](/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) |