Re: "Hidden" ambient light??

New Message Reply Date view Thread view Subject view Author view

Jean-Luc Dery (dery++at++atlantis.discreet.qc.ca)
Tue, 19 Nov 1996 12:34:47 -0500


On Nov 19, 10:27am, Scott McMillan wrote:
> Subject: "Hidden" ambient light??
> I have been struggling with what I thought was a fog and then light
> attenuation problem for a while now. I could never seem to get the
> shading in the distance to go completely to black (until recently):
>
> I am loading Alias/OBJ models with materials whose ambient, diffuse,
> and specular components are non-zero. I have a single local
> pfLightSource, and I am setting the quadratic attenuation term rather
> high to get a significant effect. This light's ambient light has been
> set to zero, and the diffuse is essentially white. But the geometry in the
> distance was still slightly lit. Even when I turned the attenuation WAY up,
> the geometry would dim to a certain point but never go black.
>
> I finally fixed the problem, by setting the ambient components of the
> materials to zero. Now if I understand what I read in the OpenGL manual last
> night, this would seem to imply there is an ambient light source somewhere.
> I haven't added one though, and pfPrint only shows the one light source I
> added.
>
> Is there a ambient light source that Performer/OpenGL sets up by default? If
> so, how do I turn it off? If not, can anybody clue me in to what is
> happening?

Hi Scott,

There is, in the GL/OpenGL lighting model, a global ambient property which
defines an overall ambient light in the scene. This ambient light is not
produced from a light source object but from the light model. By default the
values set for ambient in the light model are R=0.2, G=0.2, B=0.2, A=1.0

So, each light source object contribute to the ambient light of a scene, and,
in addition, the light model defines another ambient light that's not from any
particular source. Even if you don't have any light source in your scene, you
can still see objects in a scene with ambient light defined from the light
model.

For changing this, you can use the following:

>From OpenGL
-----------

float lm_ambient[] = {0.2, 0.2, 0.2, 1.0};
glLightModelfv( GL_LIGHT_MODEL_AMBIENT, lm_ambient );

>From Performer
--------------

see pfLightModel::setAmbient(float r, float g, float b)

Hope this helps,

-- 
_____________________________________________________________________________

Jean-Luc Dery Discreet Logic System Engineer 5505 boul. St-Laurent, bureau 5200 3-D Graphics Technology Montreal (Quebec), Canada, H2T 1S6 Tel: (514) 272-0525 #394 Email: dery++at++discreet.com Fax: (514) 272-0585 _____________________________________________________________________________ ======================================================================= List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/ Submissions: info-performer++at++sgi.com Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:53:58 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.