[rendering] only a part of the scene

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
lor
Posts: 22
Joined: Sat Aug 27, 2005 2:07 pm

[rendering] only a part of the scene

Post 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 ??
Guest

Post 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.
lor
Posts: 22
Joined: Sat Aug 27, 2005 2:07 pm

Post by lor »

And how to use viewports in irrlicht ?? And tell me, whether they aren't too slow ?? :roll:
Conquistador
Posts: 340
Joined: Wed Sep 28, 2005 4:38 pm
Location: Canada, Eh!

re:

Post by Conquistador »

lor
Posts: 22
Joined: Sat Aug 27, 2005 2:07 pm

Post 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 ??
pfo
Posts: 370
Joined: Mon Aug 29, 2005 10:54 pm
Location: http://web.utk.edu/~pfox1

Post 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
lor
Posts: 22
Joined: Sat Aug 27, 2005 2:07 pm

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