D3D style Ambient in OpenGL

Started by
1 comment, last by stefu 22 years, 9 months ago
Hi, In D3D you can set pd3dDevice->SetRenderState(D3DRS_AMBIENT,(DWORD)D3DXCOLOR(0.5,0.5,0.5,1.0)). What is corresponding in OpenGL? I know I can set glLightfv(GL_LIGHT0,GL_AMBIENT,LightAmbient); but I think that corresponds to the Ambient in D3DLIGHT8 (pd3dDevice->SetLight(0,&light)). I need to know it for my D3D/OGL wrapper.
Advertisement
Well, I don''t know what this does pd3dDevice->SetRenderState(D3DRS_AMBIENT,(DWORD)D3DXCOLOR(0.5,0.5,0.5,1.0));

maybe its the same as this

GLfloat ambient_light[] = {1.0f, 0.5f, 1.0f, 1.0f};
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambient_light);
----------------------------www.physicsforums.comwww.opengl.org
Oops, it was that simple. Hope it does the same. Thanks.

This topic is closed to new replies.

Advertisement