[fixed]RTT
-
- Posts: 10
- Joined: Tue Jan 20, 2009 2:40 pm
[fixed]RTT
is it true, that it is not guranteed that the rendertarget-texture has the size, which i told i want to? i tried to implement post processing by rendering the whole scene in a rtt and placing this scene onto a rectangle on the screen. it works perfectly, but on some pcs just the upper left part of the screen is filled and i found out that this problem also comes up, when i for instance create a rtt with the size of 2048x2048 with a screen resolution of 1280x1024.
if so, which parts of the engine do i have to modify in order to get the right mouse coordinates?
the next problem i have is concerned the highest possible resolution for the monitor with WINDOW-MODE. for instance on 1280x800 on my notebook i see nothing and on my pc the problem is concerned with 1280x1024. when i turn to fullscreen, everything works fine.
Fullscreen-Mode / without pp:
vs.
Windowed-Mode:
thank you for your help!
if so, which parts of the engine do i have to modify in order to get the right mouse coordinates?
the next problem i have is concerned the highest possible resolution for the monitor with WINDOW-MODE. for instance on 1280x800 on my notebook i see nothing and on my pc the problem is concerned with 1280x1024. when i turn to fullscreen, everything works fine.
Fullscreen-Mode / without pp:
vs.
Windowed-Mode:
thank you for your help!
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
How do you render to into the RTT when the problems arise? If you render with exact pixel positions, the RTT would be filled only in the upper left corner. Also make sure that your viewport is properly set for the RTT.
The maximal resolution should be less than the desktop size, even though larger oes might also work. Your screens look like the zbuffer isn't large enough, which usually happens when rendering to larger buffers than possible. Show the full code.
The maximal resolution should be less than the desktop size, even though larger oes might also work. Your screens look like the zbuffer isn't large enough, which usually happens when rendering to larger buffers than possible. Show the full code.
-
- Posts: 10
- Joined: Tue Jan 20, 2009 2:40 pm
rtt
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.
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
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);
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
-
- Posts: 10
- Joined: Tue Jan 20, 2009 2:40 pm
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Hmm, strange. I'll try to test this in the next days. I'll also move this thread to bugs forum in order to track this problem. You can also help us by adding the problem to the bug tracker here https://sourceforge.net/tracker/?atid=5 ... unc=browse
-
- Posts: 10
- Joined: Tue Jan 20, 2009 2:40 pm
fix?
are there any news concerned the rtt-"bug?"? i have now "fixed" it in my case and just create now in window-mode a slightly bigger rtt!
-
- Posts: 10
- Joined: Tue Jan 20, 2009 2:40 pm
-
- Posts: 10
- Joined: Tue Jan 20, 2009 2:40 pm
rtt
i have now copied the parts of the new cd3d9driver.cpp.
is this the new part of the checkDepthBuffer-Method?
thx
is this the new part of the checkDepthBuffer-Method?
with this lines it doesn't appear on most of my pcs, but the bug on my laptop at 1280x800 is not really fixed. has this something to do, that antialising also doesn't work at this resolution windowed?depth->Surface->GetDesc(&desc);
depth->Size.set(desc.Width, desc.Height);
thx