Use rtt with fitting size.
This commit is contained in:
parent
4ff8b813fa
commit
c465900ee3
@ -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);
|
||||
}
|
||||
}
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -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;
|
||||
|
@ -113,7 +113,7 @@ enum TypeFBO
|
||||
class RTT
|
||||
{
|
||||
public:
|
||||
RTT();
|
||||
RTT(size_t width, size_t height);
|
||||
~RTT();
|
||||
|
||||
unsigned getShadowFBO() const { return shadowFBO; }
|
||||
|
Loading…
Reference in New Issue
Block a user