thx, i fixed the first bug, it actually was concerned with the problem you mentioned. it normally perfectly works to create a rtt with the same size as the resolution, but when i use 1280x800 windowed it just doesn't work. i stepped through the code and saw that the buffer is shared. it seems rather weired that 1280x785 for instance work. it is also possible to create and use a texture with the size of 2048x2048 (here a new buffer is created as i explored in the code). is it possible that this something to do with the title-bar of windows? i experienced the same problem on other pcs and monitors, but the problem always just turns up in windowed-mode.
Code: Select all
bool CPostRenderer::init( core::dimension2du size )
{
renderRect = new sktx::CTransformedRect(core::vector2di(0, 0),
core::vector2di(SINST->getWidth(), SINST->getHeight()),
video::SColor(255, 255, 255, 255),
core::vector2df(1.0f, 1.0f),
(video::E_MATERIAL_TYPE)(SHINST->getShaderId(sktx::EST_POSTP)));
renderTarget = VIDINST->addRenderTargetTexture (size);
smallTarget = VIDINST->addRenderTargetTexture (size / (int)(RSFACT)); //RSFACT => 10.f
}
//in the loop sooner or later
VIDINST->setRenderTarget(renderTarget, true, true, video::SColor(255, 0, 0, 0));
//drawing-part of the gui, fonts, ...
VIDINST->setViewPort(rect<s32>(position2di(0, 0), VIDINST->getScreenSize()));
SCEINST->drawAll();
//set size back
VIDINST->setViewPort(rect<s32>(position2di(0, 0), renderTarget->getSize()));
//other 2d-drawings
VIDINST->setRenderTarget(smallTarget, true, true, video::SColor(255, 0, 0, 0));
renderRect->getMaterial().MaterialType = (video::E_MATERIAL_TYPE)(SHINST->getShaderId(sktx::EST_POSTDWN));
renderRect->draw();
setRTT(true, NULL);
renderRect->getMaterial().MaterialType = (video::E_MATERIAL_TYPE)(SHINST->getShaderId(sktx::EST_POSTP));
//rfact is calculated by
/*rfact.X = VIDINST->getScreenSize().Width / (float)renderTarget->getSize().Width;
rfact.Y = VIDINST->getScreenSize().Height / (float)renderTarget->getSize().Height;*/
//renderRect draws the vertexprimitivelist
//and sets the new texture-coordinates given (rfact)
/*
setTCoords(texScale);
VIDINST->setMaterial(mat);
VIDINST->drawVertexPrimitiveList((const void*)vertices, 4, (const u16*)indices,
2, video::EVT_STANDARD, EPT_TRIANGLES, EIT_16BIT);
*/
renderRect->draw(rfact);
dimension2du is just an alias, because i tried to change to 1.6, but then postponed it. sorry, it is rather bad formatted

.
have you ever tried to draw a rtt as big as the maximum resolution of the monitor and display it in windowed-mode? is there any other solution instead of modifying the size?
thanks,
markus