Jump to content

View more

Image of the Day

#ld38 #screenshotsaturday Mimosa Fizz action gif #2 https://t.co/TUzdppvfUL
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

How do I optimize GUI rendering

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
7 replies to this topic

#1 comfy chair   Members   

847
Like
0Likes
Like

Posted 22 November 2012 - 10:42 AM

When I turn off GUI rendering in my game, I gain around 10-15 FPS. I have also determined that my game is CPU-bound. This makes me think I ought to optimize it. But how?

The GUI is rendered using many small sprites and a few custom shaders.

What is the normal way? Is it to render into a render target and somehow do occasional re-renders only when something changes?


By the way, I code in XNA. Thank you.

Edited by comfy chair, 22 November 2012 - 10:44 AM.


#2 Waterlimon   Members   

4398
Like
2Likes
Like

Posted 22 November 2012 - 10:56 AM

10-15 fps change doesnt tell anything without the fps value it affects.

If you take 15 fps away from 1000 fps, i dont think you have a problem...

o3o


#3 C0lumbo   Members   

4366
Like
0Likes
Like

Posted 22 November 2012 - 11:32 AM

Are your 2D sprites atlassed and batched sensibly?

It would be useful to know how many quads are rendered in your GUI and how many draw calls you are making to draw them.

Edited by C0lumbo, 22 November 2012 - 11:33 AM.


#4 MJP   Moderators   

19483
Like
1Likes
Like

Posted 22 November 2012 - 11:50 AM

10-15 fps change doesnt tell anything without the fps value it affects.

If you take 15 fps away from 1000 fps, i dont think you have a problem...


What this guy said. FPS is not a linear measure of performance. I would suggest always describing things in terms of milliseconds per frame, and always using that metric when profiling.

#5 comfy chair   Members   

847
Like
0Likes
Like

Posted 22 November 2012 - 12:59 PM

If I have 45 fps I can get to 60 FPS by turning GUI rendering off.

#6 MrDaaark   Members   

3552
Like
0Likes
Like

Posted 22 November 2012 - 01:28 PM

Put all your GUI sprites on one texture sheet to kill material changes. Make some kind of vertex buffer object to draw them all in one pass, and only update it when something changes.

#7 MJP   Moderators   

19483
Like
1Likes
Like

Posted 22 November 2012 - 03:18 PM

If you're using SpriteBatch, it will automatically batch sprites using the same texture. So if you use a texture atlas, you could potentially reduce your number of Draw calls by quite a bit.

#8 comfy chair   Members   

847
Like
0Likes
Like

Posted 22 November 2012 - 03:36 PM

I use both SpriteBatch and a sprite sheet.

I think perhaps it is the culling and clipping that is responsible.




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.