Page 1 of 1

Cliping Viewports

Posted: Mon Sep 08, 2008 7:05 pm
by Riki
Is there a way I could clip the Viewport to be smaller than the ViewPorts height & width.

The reason is that in my RPG a fairly large part of the screen is constantly covered with few textures (like sidebars at top bottom and right or left). Since the scene is effectively never visible over the whole screen there is no point in rendering everything just to be covered with the textures.

I guess the real question is: can I somehow tell Irrlicht to change its frustum culling based on the precalculated "visible" rectangle area?

Posted: Mon Sep 08, 2008 9:47 pm
by hybrid
I guess you just want to change the viewport and render only into a part of the screen? The rest of the screen would be kept unchanged, but only until that part is "destroyed", e.g. by moving other windows over it. Since you cannot detect this in Irrlicht ATM, you would have to render into this part every say 10 frames or so.

Posted: Tue Sep 09, 2008 5:54 am
by Riki
thnx hybrid,
that might just do it!

Posted: Tue Sep 09, 2008 7:15 am
by hybrid
Yeah, I just found a rather limiting factor: You'd need to clean the depth buffer only and do the viewport framebuffer cleanup manually. In case you have a skybox or something this would work, but otherwise you'd have to fill the whole viewport first with some backcolor. Depending on the ratio of "border" and viewport this might become rather inefficient. But just check it out and measure the performance.