gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > double buffer for 3d with capture [solved]

#150967 - nce - Sat Feb 16, 2008 3:32 am

Hi all,

I was thinking about the technic using the capture to double the limit of polygon you can render.

From all example I read and all discution here, everybody is using 2 banks to do it like this :

-render A, show A on top of last captured B
-render B, show B under last captured A

My concern with this methode is mainly all the motions.
Your 2 buffer are update separatly. It means that if things are moving, you'll probably noticed that they move at separate time.

It's even worse when you think about camera motion, You'll always have a part of your scene shown with the old camera and one part with the new.

So to make this technic working you don't need a double buffer but a tripple.

-animate, camera
-render A1, show A2 on top of B
-render B, show B under A1
-swap A1 and A2

well now loosing 3banks looks a quite expensive and I'm not sure that any commercial game are ready to loose so many memory.

If you think about the memory your bank is 256*256 but you need only 256*192 for your buffer.

Is there any solution to goup those 3 buffers?
like telling that you bufferA1 is at BankA, bufferA2 at BankA+96k, bufferB at BankB+64k and your texture starts at BankC+32k ?

Unfortunetly it means that some bank will be used to display and capture at the same time, or like bankC that will be used to capture/display and texture source.... I'm not sure at all that you can ask for that.

Can anybody confirm this ?
Is it possible? or am I completly wrong at the begining ?

Cheers,
_________________
-jerome-


Last edited by nce on Sat Feb 16, 2008 10:11 am; edited 1 time in total

#150976 - Cydrak - Sat Feb 16, 2008 8:46 am

When I did this I only show a new image every full pass. So there's never any desync. The key is the display source. If you set it to a framebuffer, you can grab some offscreen renders, at the price of framerate.

- do scene updates
- display normal / submit B / render+capture A atop B
- display A atop B / submit A atop B / render+capture B
- rinse, repeat
(I've split submission and rendering; the latter starts the frame after glFlush, so that's when you have to capture... and when that scene's textures are needed.)

You can set _framebuffer_ display and capture on the same bank (not sure which happens first). They both use LCD. Unfortunately, you have to choose LCD or TEXTURE target for the frame. Maddening, I know. :(

#150980 - nce - Sat Feb 16, 2008 10:10 am

Thanks,

I was completly wrong ;)

Your answer, force me to reread the capture tech :) I a just realize that you can capture both 3d layer and bg at the same time...
I was thinking that you can capture only the 3d layer ...

Thanks,
_________________
-jerome-