how to go about implementing sub-region rendering?

Started by
6 comments, last by Fairywingsrpg 9 years, 7 months ago

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?

Advertisement

What kind of sub-regions you are talking about? Please give us some details to work with...

Wiggle room?

Previously "Krohm"

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.

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.

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

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

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.

Omae Wa Mou Shindeiru

Generally culling is the way to go, but we don't know his intentions.

This topic is closed to new replies.

Advertisement