Use rtt with fitting size.

This commit is contained in:
vlj 2014-05-17 02:05:31 +02:00
parent 4ff8b813fa
commit c465900ee3
3 changed files with 6 additions and 4 deletions

View File

@ -1562,7 +1562,9 @@ void IrrDriver::onLoadWorld()
{
if (m_glsl)
{
m_rtts = new RTT();
const core::recti &viewport = Camera::getCamera(0)->getViewport();
size_t width = viewport.LowerRightCorner.X - viewport.UpperLeftCorner.X, height = viewport.LowerRightCorner.Y - viewport.UpperLeftCorner.Y;
m_rtts = new RTT(width, height);
}
}
// ----------------------------------------------------------------------------

View File

@ -51,14 +51,14 @@ static GLuint generateFBO(GLuint ColorAttachement, GLuint DepthAttachement)
return fbo;
}
RTT::RTT()
RTT::RTT(size_t width, size_t height)
{
initGL();
using namespace video;
using namespace core;
IVideoDriver * const drv = irr_driver->getVideoDriver();
const dimension2du res(UserConfigParams::m_width, UserConfigParams::m_height);
const dimension2du res(width, height);
const dimension2du half = res/2;
const dimension2du quarter = res/4;
const dimension2du eighth = res/8;

View File

@ -113,7 +113,7 @@ enum TypeFBO
class RTT
{
public:
RTT();
RTT(size_t width, size_t height);
~RTT();
unsigned getShadowFBO() const { return shadowFBO; }