howto speed up rendering with 5 viewports

Started by
18 comments, last by aggressor 18 years, 9 months ago
allo, i'm working with 5 viewports and noticed that the graphics is rotating rather slow. I think its the repeatative re-initialising of the viewports in the draw loop. is there a better way to achieve higher visual performance and yet maintaining the 5 viewports. ciao
Advertisement
You could try coping the projection matrices and just reloading them whenever you need to.

Cheers,
- llvllatrix
If you are rendering the same meshes, you could use "Instancing".

I heard about it that you only need to send the vertex data to the graphics card once instead of 5 times (correct me?!).

You could also pre-transform the vertices in your program instead of matrices and use a vertex shader without matrix calculations.
openGL does not have instancing, instancing is a d3d thing, it is not needed in openGL.

To speed things up you could try VBO, but not all hardware supports that.

allso remember, 5 viewports take five times as mutch time to render than one.
Quote:Original post by Daniel Lee
I think its the repeatative re-initialising of the viewports in the draw loop.


Find out for sure. It'd be a shame for you to put lots of effort into speeding one thing up, only to find it's another.

How many polys are you drawing? any shaders? how fast is it with 1 viewport and the same geometry + shaders? how fast is it with 5 viewports and simpler geometry + shaders? How fast drawing the geometry and shaders 5 times in one viewport?

Find these things out, and you'll probably have the answer.
[size="1"]
What you want to do is check the time it takes to render 1 viewport 1000times
and then check the time it takes to render 5 viewports 1000times.

This is what the result should be if its just because of render 5 times the ammount of stuff
5 * SingleViewportTime = PentViewportTimes * 1
ie
1 Viewport takes 10 secs
5 viewports takes 50 secs

then there isnt really anything that could be done.

----------------------------

http://djoubert.co.uk
well looks like its there to stay. In my app those vertex are already in display lists. Maybe the nearest thing is to use
another higher performance card though the case of Dollar&Cents.

what do you think.
ciao
Is this for a modelling program or game?

Could you only refresh when needed? Like if you need to rotate in one viewport, update that viewport only when you are doing something in that one. Stop once you are done with it...

If it is possible, I would also advise using VBOs.
When I converted my project from using Display Lists to VBOs, I had a performance increase of 300% and up.
Fake it with one viewport (one context) and scissoring.

This topic is closed to new replies.

Advertisement