Wii Screen Refresh *RESOLVED* April 26, 2010 07:27AM | Registered: 13 years ago Posts: 121 |
Re: Wii Screen Refresh April 26, 2010 09:49AM | Registered: 13 years ago Posts: 40 |
Re: Wii Screen Refresh April 26, 2010 10:10AM | Registered: 13 years ago Posts: 121 |
Quote
calvinss4
If you have a static background you can just render it into a texture and draw it on a full screen quad every frame.
Re: Wii Screen Refresh April 26, 2010 10:44AM | Registered: 14 years ago Posts: 379 |
Re: Wii Screen Refresh April 26, 2010 08:49PM | Registered: 13 years ago Posts: 40 |
Re: Wii Screen Refresh April 27, 2010 01:13AM | Registered: 14 years ago Posts: 552 |
Re: Wii Screen Refresh April 27, 2010 01:50AM | Registered: 13 years ago Posts: 121 |
Quote
Daid
Double buffering makes is almost a requirement to redraw everything. As you don't have the buffer of the previous frame to draw on, but of the frame before that. (So while you see Buffer 1 on the screen, you draw on Buffer 2, and then you view Buffer 2 and draw on Buffer 1)
So 99% of the time it's easier to do a full redraw.
But you can get away by not drawing anything and then don't flip the buffers. Loading screens for example, draw "LOADING" on the screen, load everything and during the load you don't update the screen.
Re: Wii Screen Refresh April 27, 2010 02:03AM | Registered: 13 years ago Posts: 121 |
Quote
calvinss4
I didn't miss the point; quite the opposite actually.
Of course you can leave an image on the screen; the VIDEO framework isn't going to refill the screen unless you tell it to.
Quote
calvinss4
Now, the entire second half of your post talks about drawing a moving object on a static background. Since you're quite a curious felluh, I think it's best you understand how this entire process works:
1. Issue a GX command.
2. The CPU pipes it to the GP (Graphics Processor).
3. The GP renders into the EFB (Embedded Frame Buffer).
4. The EFB is copied to the XFB (External Frame Buffer). The XFB is in main memory (DRAM); as Daid said, the standard is to have two buffers.
4.1 While the copy operation occurs, the EFB color and z-values are simultaneously cleared.
5. The XFB is handed off to the VIDEO framework, which takes the buffer data and fills the screen.
Quote
calvinss4
Hence the goal of double buffering -- while the VIDEO framework is reading from XFB1, we can simultaneously copy from the EFB to XFB2.
Quote
calvinss4
Do you see the issue with partial screen updating now? To fully optimize this you'd have to disable the clear operation so that the EFB's color values aren't cleared, redraw the section where the sprite used to be, draw the section where the sprite is now, find the bounding rectangle and only copy that section of the EFB to the XFB. Sure it might be possible, but this isn't the bottleneck of your program, so there's no point in optimizing it.
Quote
calvinss4
That brings us full circle. If you have a static background composed of complex geometry, render it into the EFB and save it into a texture (this is used for pretty pre-rendered backgrounds as made famous on the PS1); otherwise, just use a PNG.
Re: Wii Screen Refresh April 27, 2010 02:20AM | Registered: 13 years ago Posts: 121 |
Quote
mdbrim
"moot" not "mute" :D
Quote
mdbrimQuote
mdbrim
yes you can draw your stuff outside a while loop... we usually have it in the loops so that things can change (animation, switches, etc)
Thanks. Daid already confirmed this for me.Quote
mdbrim
Partial screen updating (like cale mentioned) wouldn't be really worth it.
Thanks. Cale explanation was great...now I understand why it is not worth it.
Lord Ashes
Re: Wii Screen Refresh *RESOLVED* April 27, 2010 03:38AM | Registered: 14 years ago Posts: 552 |