Sign in to follow this  

how to go about implementing sub-region rendering?

This topic is 1242 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

I'm finishing the renderer for my engine and I'm not quite sure what the most efficient method for implementing redraw regions would be. Does anyone have any advice for efficient detection of changes in the framebuffer and if any/how much wiggle room should be allowed in those changes?

Edited by ReadingSteiner

Share this post


Link to post
Share on other sites

Sorry, let me clarify. I'm referring to regions of the screen that would need to be redrawn each frame.

 

Edit: I shouldn't be posting after crunch sessions, I meant to say redraw regions.

Edited by ReadingSteiner

Share this post


Link to post
Share on other sites

Use a bounding Rect encapsulating all draws to the screen. Track your draws to the screen and clear only the area according to the Rect.

Share this post


Link to post
Share on other sites

If we are talking about a game, the whole screen is redrawn every frame.

Otherwise you need to be more specific as to your goals.

 

 

L. Spiro

Share this post


Link to post
Share on other sites

If we are talking about a game, the whole screen is redrawn every frame.

Otherwise you need to be more specific as to your goals.

What remains provably constant between frames is usually a bezel or a background image, and rendering this kind of thing is a large but dirt cheap blitting operation.

Everything else has a chance to remain constant (e.g. entering a pause mode, perfect immobility) but ordinarily there is no reason for optimizations:

  • Your performance target is being able to draw all objects to the whole screen every frame: making a "lucky" case.cheaper is pointless.
    Instead, drawing performance is improved by reducing the worst case number and cost of draw calls regardless of what changes from frame to frame (for instance, limiting the number of game entities in the game rules to limit drawn objects).
  • Tracking regions where you aren't going to draw anything does little good: you are drawing objects, not screen regions, and a small dirty region means that the objects are concentrating the same amount of drawing effort into a smaller part of the frame buffer, which might or might not be good for performance.
    Instead, you should cull objects to do less work, but culling criteria include importance, visibility and the like, not screen-space location.
Edited by LorenzoGatti

Share this post


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