D3D中设置环境光不起作用,请有经验的帮我看看
D3DLIGHT9 light;
ZeroMemory( &light, sizeof(D3DLIGHT9) );
light.Type = D3DLIGHT_POINT;
light.Diffuse.r = 0.5f;
light.Diffuse.g = 0.0f;
light.Diffuse.b = 0.0f;
light.Position=D3DXVECTOR3(100.0f,100.0f,0.0f);
light.Range = 1000.0f;
pd3dDevice->SetRenderState( D3DRS_AMBIENT, 0xFFFFFFFF );
pd3dDevice->SetRenderState(D3DRS_LIGHTING,TRUE);
pd3dDevice->SetLight( 0, &light );
pd3dDevice->LightEnable(0,TRUE);
点光源没问题,但环境光
pd3dDevice->SetRenderState( D3DRS_AMBIENT, 0xFFFFFFFF );
和pd3dDevice->SetRenderState( D3DRS_AMBIENT, 0x11111111 );
效果是一样的,都没光
而以前我写过的程序有很大区别的,请问是为什么?
哪儿还需要设置才能正常显示环境光?