Implement GX-style faked directional

This commit is contained in:
Jack Andersen 2016-04-04 11:20:26 -10:00
parent c26a288a8c
commit 909baea2cd
2 changed files with 6 additions and 2 deletions

View File

@ -74,8 +74,9 @@ void ViewManager::ParticleView::draw(boo::IGraphicsCommandQueue *gfxQ)
CGraphics::SetPerspective(55.0, aspect, 0.001f, 1000.f); CGraphics::SetPerspective(55.0, aspect, 0.001f, 1000.f);
std::vector<CLight> lights = {CLight::BuildLocalAmbient({}, {0.5f, 0.5f, 0.5f, 1.f}), std::vector<CLight> lights = {CLight::BuildLocalAmbient({}, {0.5f, 0.5f, 0.5f, 1.f}),
CLight::BuildCustom({0.f, -2.f, 1.f}, {0.f, 1.f, 0.f}, CLight::BuildCustom({0.f, -20.f, 10.f}, {0.f, 1.f, 0.f},
{20.f, 20.f, 20.f, 1.f}, 0.f, 0.f, 1.f, 1.f, 0.f, 0.f)}; {200.f, 200.f, 200.f}, 0.f, 0.f, 1.f, 1.f, 0.f, 0.f),
CLight::BuildDirectional({0.f, 0.f, -1.f}, {0.3f, 0.3f, 0.3f})};
m_vm.m_modelTest->GetInstance().ActivateLights(lights); m_vm.m_modelTest->GetInstance().ActivateLights(lights);
m_vm.m_modelTest->Draw(flags); m_vm.m_modelTest->Draw(flags);
} }

View File

@ -215,6 +215,9 @@ void CBooModel::ActivateLights(const std::vector<CLight>& lights)
lightOut.angAtt[0] = light.x30_angleC; lightOut.angAtt[0] = light.x30_angleC;
lightOut.angAtt[1] = light.x34_angleL; lightOut.angAtt[1] = light.x34_angleL;
lightOut.angAtt[2] = light.x38_angleQ; lightOut.angAtt[2] = light.x38_angleQ;
if (light.x1c_type == ELightType::Directional)
lightOut.pos = (-lightOut.dir) * 1048576.f;
break; break;
} }
default: break; default: break;