Jump to content

  • Log In with Google      Sign In   
  • Create Account

how to go about implementing sub-region rendering?


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 ReadingSteiner   Members   -  Reputation: 103

Like
0Likes
Like

Posted 20 August 2014 - 11:17 PM

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, 21 August 2014 - 03:50 AM.


Sponsor:

#2 haegarr   Crossbones+   -  Reputation: 4586

Like
0Likes
Like

Posted 21 August 2014 - 02:26 AM

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



#3 Krohm   Crossbones+   -  Reputation: 3245

Like
0Likes
Like

Posted 21 August 2014 - 03:03 AM

Wiggle room?



#4 ReadingSteiner   Members   -  Reputation: 103

Like
0Likes
Like

Posted 21 August 2014 - 03:29 AM

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, 21 August 2014 - 03:49 AM.


#5 lorem   Members   -  Reputation: 651

Like
0Likes
Like

Posted 21 August 2014 - 05:34 AM

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.



#6 L. Spiro   Crossbones+   -  Reputation: 14257

Like
0Likes
Like

Posted 21 August 2014 - 07:00 AM

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


It is amazing how often people try to be unique, and yet they are always trying to make others be like them. - L. Spiro 2011
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
I went to my local Subway once to find some guy yelling at the staff. When someone finally came to take my order and asked, “May I help you?”, I replied, “Yeah, I’ll have one asshole to go.”
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums

#7 LorenzoGatti   Crossbones+   -  Reputation: 2763

Like
1Likes
Like

Posted 22 August 2014 - 01:44 AM

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, 22 August 2014 - 01:45 AM.

Produci, consuma, crepa

#8 lorem   Members   -  Reputation: 651

Like
0Likes
Like

Posted 23 August 2014 - 06:14 PM

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


Edited by lorem, 23 August 2014 - 06:18 PM.





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.



PARTNERS