I added spot light using DX but the lighting doesn't look good.
I attached a Screen shot - the light pos is at the center of the car.
for testing I use the arena from one of the samples which has big polygons. if the lighting goes through but dont intersect the vertex its not lit at all.
If ill use for the floor a cube with texture with only 2 polygons for face the problem would get worse.
- Do I need a arena with lots of small polygons?
- I found in the forums a trick using a transparent cone but I dont think it will be good enough.
- I have to use a pixel shader for this or there's another solution ?
(I have little experience with PS)
The params I used:
Code: Select all
m_lightInfo = new D3DLIGHT9;
ZeroMemory( m_lightInfo, sizeof(*m_lightInfo) );
m_lightInfo->Type = D3DLIGHT_SPOT;
//m_lightInfo->Ambient.r = 1.0f;
//m_lightInfo->Ambient.g = 1.0f;
//m_lightInfo->Ambient.b = 1.0f;
//m_lightInfo->Ambient.a = 1.0f;
m_lightInfo->Diffuse.r = 1.0f;
m_lightInfo->Diffuse.g = 0.7f;
m_lightInfo->Diffuse.b = 0.7f;
m_lightInfo->Diffuse.a = 1.0f;
m_lightInfo->Specular.r = 1.0f;
m_lightInfo->Specular.g = 1.0f;
m_lightInfo->Specular.b = 1.0f;
m_lightInfo->Specular.a = 0.0f;
m_lightInfo->Range = 500.0f;
m_lightInfo->Falloff = 1.0f;
m_lightInfo->Phi = irr::core::PI/8.0f;
m_lightInfo->Theta = irr::core::PI/16.0f;
m_lightInfo->Attenuation0 = 0;
m_lightInfo->Attenuation1 = 1.0f / m_lightInfo->Range;
m_lightInfo->Attenuation2 = 0;