Page 1 of 1

[rendering] only a part of the scene

Posted: Wed Oct 05, 2005 12:49 pm
by lor
Hi there. I've got a serious problem becouse of speed of my program. I want to draw my scene only in some rectangle. I mean: I've got a 800x600 window, there is a 2-d graphical menu in rect (0,600,600,800), there are special 2d in the outsides of the left rect (for example (0,0,600,9)). Now I want to render my scene only in the left rectangle - in (9,9,600,591), this will couse no need of making each frame the menu from the beginning, and smaller size of the render, so it will increase the speed.
The question: How to render my scene each frame only in this rect (9,9,600,591) and leave etherything else alone ??

Posted: Wed Oct 05, 2005 1:11 pm
by Guest
Can viewports help you here? I can't remember if they have seperate updates (haven't used them in irrlicht, only in my old dx engine) if so you should set up seperate viewports and just update the one with the scene in.

If you are thinking more along "dirty rects" (for 2D) then google should help there.

Posted: Wed Oct 05, 2005 4:09 pm
by lor
And how to use viewports in irrlicht ?? And tell me, whether they aren't too slow ?? :roll:

re:

Posted: Wed Oct 05, 2005 5:46 pm
by Conquistador

Posted: Wed Oct 05, 2005 7:43 pm
by lor
Ok, I did this using viewports, but there is such a problem:

Code: Select all

(...)
draw menu
(...)
set viewport
(...)
while(device->run)
   draw what's neccessarly
(...)
On problem, is that my menu disappears, and I need it to be seem.
Another problem is that I can't move my cursor over my menu ;/

Anyway, the viewport increased FPS from 300 to 450 !! So that's exactly what I need. But it doesn't work properly. How to deal with this ??

Posted: Wed Oct 05, 2005 7:55 pm
by pfo
There must be an easier way to decrease the ammount of calculations being done. What slows your scene down so much?
there is a 2-d graphical menu in rect (0,600,600,800)
Do you mean there is a menu (or something) in the ENTIRE window? If so, that is what is slowing you down I think.
On problem, is that my menu disappears, and I need it to be seem.
The reason why your menu disappears, is probably because when you render, it won't draw your menu because it is outside of the viewport. Everything you want to render with Irrlicht must be within the viewport

Posted: Thu Oct 06, 2005 10:20 am
by lor
ok, so I think it's a bad solution. Another problem with using viewport is that it deforms the scene -> it tries to put the whole view from the camera into the viewport. And what I need is to put the same scene that is being seen in the view rectangle but simply without ereaseing everything else...