Add shadow scale parameters

This commit is contained in:
Vincent Lejeune 2014-11-18 02:53:02 +01:00
parent b288d9c8c4
commit b7fc539f57
2 changed files with 7 additions and 3 deletions

View File

@ -378,6 +378,7 @@ private:
class STKMeshSceneNode *m_sun_interposer;
scene::CLensFlareSceneNode *m_lensflare;
scene::ICameraSceneNode *m_suncam;
std::pair<float, float> m_shadow_scales[4];
scene::ICameraSceneNode *m_shadow_camnodes[4];
float m_shadows_cam[4][24];

View File

@ -904,10 +904,13 @@ void IrrDriver::computeCameraMatrix(scene::ICameraSceneNode * const camnode, siz
// Prevent Matrix without extend
if (left != right && up != down)
{
tmp_matrix.buildProjectionMatrixOrthoLH(left, right,
down, up,
float(CBB[currentCBB][i].zmin / 4 - 100),
float(CBB[currentCBB][i].zmax / 4 + 2) );
down, up,
float(CBB[currentCBB][i].zmin / 4 - 100),
float(CBB[currentCBB][i].zmax / 4 + 2));
m_shadow_scales[i] = std::make_pair(right - left, down - up);
}
}
else
tmp_matrix = getTighestFitOrthoProj(SunCamViewMatrix, vectors);