Jump to content
  • Advertisement


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


Ambient Light Setting

This topic is 5988 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

Shouldn't simply

	g_pD3DDevice->SetRenderState(D3DRS_AMBIENT, D3DCOLOR_RGBA(255,255,255,255));

set a white ambient light? I don't see it at all; there are still totally black spots where objects are that should be lit a little. And can you control the intensity of ambient light? I have turned lighting on and everything, and I have a point light. Everywhere I look says that just that command should work, but I'm not seeing any ambience? [edited by - okonomiyaki on June 23, 2002 1:29:34 PM]

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
As far as i know does the ambient light affect the specular vertex color component of an object by default. If there''s no specular vertex color or it''s set all to black the ambient light will have no effect. You can instead use the current material for ambient lighting calculations by setting the D3DRS_AMBIENTMATERIALSOURCE to D3DMCS_MATERIAL. Works fine with the default material and even if you turn lighting off

Share this post

Link to post
Share on other sites
Make sure a valid material is set [IDirect3DDevice*::SetMaterial()].

Also make sure that the ambient value in the material isn''t set to 0. D3D multiplies the currently set ambient colour (D3DRS_AMBIENT) by the ambient value in the material, so if the ambient value in the material is 0, then the ambient colour used is multiplied by 0 (0 * a_number = 0)

Simon O''Connor
Creative Asylum Ltd

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!