Cliping Viewports

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Riki
Posts: 30
Joined: Tue Feb 27, 2007 9:12 pm
Location: Croatia

Cliping Viewports

Post 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?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post 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.
Riki
Posts: 30
Joined: Tue Feb 27, 2007 9:12 pm
Location: Croatia

Post by Riki »

thnx hybrid,
that might just do it!
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post 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.
Post Reply