RTT: calculate diffuse coefficients only once
This commit is contained in:
parent
fa027c11da
commit
01b9ee2a63
@ -56,6 +56,7 @@ RTT::RTT(size_t width, size_t height)
|
||||
m_RH_FBO = NULL;
|
||||
m_RSM = NULL;
|
||||
m_RH_FBO = NULL;
|
||||
m_diffuse_coefficients_calculated = false;
|
||||
using namespace video;
|
||||
using namespace core;
|
||||
|
||||
@ -294,7 +295,12 @@ void RTT::prepareRender(scene::ICameraSceneNode* camera)
|
||||
{
|
||||
irr_driver->setRTT(this);
|
||||
irr_driver->getSceneManager()->setActiveCamera(camera);
|
||||
irr_driver->generateDiffuseCoefficients();
|
||||
|
||||
if (!m_diffuse_coefficients_calculated)
|
||||
{
|
||||
irr_driver->generateDiffuseCoefficients();
|
||||
m_diffuse_coefficients_calculated = true;
|
||||
}
|
||||
}
|
||||
|
||||
FrameBuffer* RTT::render(scene::ICameraSceneNode* camera, float dt)
|
||||
|
@ -62,6 +62,8 @@ private:
|
||||
int m_width;
|
||||
int m_height;
|
||||
|
||||
bool m_diffuse_coefficients_calculated;
|
||||
|
||||
unsigned shadowColorTex, shadowNormalTex, shadowDepthTex;
|
||||
unsigned RSM_Color, RSM_Normal, RSM_Depth;
|
||||
unsigned RH_Red, RH_Green, RH_Blue;
|
||||
|
Loading…
Reference in New Issue
Block a user