PDA

View Full Version : Equivalent to D3DRENDERSTATE_AMBIENT?



Lucretia
10-04-2000, 01:15 PM
Hi,

I need to implement a function that produces the same effect as D3DRENDERSTATE_AMBIENT in Direct3D.

Do I need to use one of my lights? If so, am I supposed to use GL_LIGHT0 - I remember seeing something about it that seemed "special" - or is there another way?

Thanks,
Luke A. Guest.

mcraighead
10-04-2000, 02:25 PM
Sounds like you want:

float color[4] = {r, g, b, a};
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, color);

- Matt

zed
10-04-2000, 08:23 PM
if u want global ambient light (applied to everything in the scene) use this
float amb[] = {0.5,0.5,0.5,1.0};
glLightModelfv(GL_LIGHT_MODEL_AMBIENT,amb);

Lucretia
10-04-2000, 11:28 PM
Yeah, thanks for that. I just found it in the red book ;-)

Thanks anyway,
Luke.