Jump to content
  • Advertisement
Sign in to follow this  
comfy chair

How do I optimize GUI rendering

This topic is 2155 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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...

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!