Hello,
for generating a video I am rendering my scene to a texture. I want to use the irrlicht-window to show the rendered texture as a video-preview.
Now I discovered that irrlicht clears my window, even if I set my rendering target to texture.
The result is that my preview is flickering.
Can anyone tell me how I can prevent irrlicht to clear my window?
Thanks in advance
Kuzy
Disable screen refresh, when rendering to texture
Re: Disable screen refresh, when rendering to texture
Check the documentation.
http://irrlicht.sourceforge.net/docu/cl ... eb0749e7eb "setRenderTarget"
http://irrlicht.sourceforge.net/docu/cl ... 81be1e9945 "beginScene"
set the "clear backbuffer" parameter to false, and the render doesn't get cleared each time.
http://irrlicht.sourceforge.net/docu/cl ... eb0749e7eb "setRenderTarget"
http://irrlicht.sourceforge.net/docu/cl ... 81be1e9945 "beginScene"
set the "clear backbuffer" parameter to false, and the render doesn't get cleared each time.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Re: Disable screen refresh, when rendering to texture
Hi Mel,
that doesn't help.
The flags only prevent the refreshing of the buffer, but the "unrefreshed" buffer is painted everytime the WM_PAINT message is fired...
that doesn't help.
The flags only prevent the refreshing of the buffer, but the "unrefreshed" buffer is painted everytime the WM_PAINT message is fired...
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: Disable screen refresh, when rendering to texture
No, that's definitely not so. There's only one framebuffer at each call that gets cleared. On beginScene it's the default backbuffer, on setRenderTarget it's the render target that will be cleared. Note, though, that on setRenderTarget(0) you will also clear the default backbuffer. So make sure that you have the flag set to flase both in beginScene and setRenderTarget(0) if you want to vavoid the clear call. Copying the backbuffer to the frontbuffer (or swapping the two) will happen on endScene, and this cannot be prevented unless by creating a much larger render loop.
Re: Disable screen refresh, when rendering to texture
When I set both flags to false, I had an ugly rendering result (but the flickering stopped).
Now I found a solution for me:
I set the rendering rectangle to zero:
SExposedVideoData videoData = SExposedVideoData(0);
rect<s32> rec = rect<s32>(0,0,0,0);
driver->beginScene(true, true, backgroundColor,videoData,&rec);
Now my window is not cleared anymore and my texture looks like it should...
Thanks to all...
Now I found a solution for me:
I set the rendering rectangle to zero:
SExposedVideoData videoData = SExposedVideoData(0);
rect<s32> rec = rect<s32>(0,0,0,0);
driver->beginScene(true, true, backgroundColor,videoData,&rec);
Now my window is not cleared anymore and my texture looks like it should...
Thanks to all...
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: Disable screen refresh, when rendering to texture
Well, if you don't clear the zbuffer you'll get strange results. The screen will only render if there's some zfight win for the render part. Of course, this would work for plain 2d rendering, which ignores the depth information. But you should not keep the zbuffer anyway. Just set the backbuffer flag to false.