Ambient Light Setting

Started by
1 comment, last by okonomiyaki 21 years, 9 months ago
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]
Advertisement
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
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
www.creative-asylum.com

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

This topic is closed to new replies.

Advertisement