Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

stefu

OpenGL D3D style Ambient in OpenGL

This topic is 6238 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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);

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!