Draw RSM only once

This commit is contained in:
Vincent Lejeune 2014-11-19 17:41:52 +01:00
parent ed2374ae05
commit d3964b8a93
3 changed files with 5 additions and 0 deletions

View File

@ -219,6 +219,7 @@ private:
core::matrix4 rh_matrix;
core::matrix4 rsm_matrix;
bool m_rsm_matrix_initialized;
bool m_rsm_map_available;
core::vector2df m_current_screen_size;
/** Additional details to be shown in case that a texture is not found.

View File

@ -953,6 +953,7 @@ void IrrDriver::computeCameraMatrix(scene::ICameraSceneNode * const camnode, siz
}
rsm_matrix = getVideoDriver()->getTransform(video::ETS_PROJECTION) * getVideoDriver()->getTransform(video::ETS_VIEW);
m_rsm_matrix_initialized = true;
m_rsm_map_available = false;
}
rh_extend = core::vector3df(128, 64, 128);
core::vector3df campos = camnode->getAbsolutePosition();

View File

@ -1121,6 +1121,8 @@ void multidrawRSM(Args...args)
void IrrDriver::renderRSM()
{
if (m_rsm_map_available)
return;
ScopedGPUTimer Timer(getGPUTimer(Q_RSM));
m_rtts->getRSM().Bind();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
@ -1151,4 +1153,5 @@ void IrrDriver::renderRSM()
renderRSMShadow<NormalMat>(rsm_matrix);
renderRSMShadow<DetailMat>(rsm_matrix);
}
m_rsm_map_available = true;
}