Has Single-surface been introduced?
BlitzMax Forums/BlitzMax Programming/Has Single-surface been introduced?
| ||
I sort of remember looking through the image.loadanim code pre-1.12 and saw it created a seperate pixmap for each frame in a loadanimimage. Looking at it now, and it seems to create a pointer to a rectangular area of the image using staticpixmaps. A quick test seems to suggest the code is running at similar speeds to Indie's SS code. Can somebody check the code and see what they think (or if BRL could comment...)? |
| ||
Anyone? |
| ||
No, I have been extensivily through the code. Each Frame of image is loaded into a seperate texture surface. Doug Stastny |
| ||
Thanks! Should be a good speed boost when/if they decide to put this in (for ogl and dx)? |
| ||
It's only my GL test that runs at similar speeds. DX is still approx 40% slower with loadanimimage. All very odd. |
| ||
DX7 is slightly slower than GL if unoptimized, optimized they are about the same speed. Being able to draw from a single surface isn't going to speed stuff up too much, as the problem lies in sending single quad to the renderer at one time. Most optimal solution is to keep as much stuff in one texture as possible, and then batch geometry by texture/render state. Without batching, you won't see much improvement, and without having everything in a single surface, batching can't work. If you want to use single surface now, there is code on this forum on how to do it, and it's very simple. Thank IndiePath for that :) http://www.blitzbasic.com/Community/posts.php?topic=51647&hl=single%20surface However, without batching geometry you cannot possibly achieve high end results like other games do. I think this is what buffered mode is trying to acomplish, but either way we need custom ways to handle this for optimal results. DrawVertexArray() function, if properly implemented, would solve all this |
| ||
Hi HrdNutz, that's the code I was comparing. Something has definately changed somewhere. I checked again and it doesn't seem to be single-surface although (at one point) there is a staticpixmap xcreated for a cell. This is then copied into the image and split into seperate frames to display. It's possible the recent changed to the DX and GL drivers have closed the gap a bit by performance improvements. There also seems to be some memory changes as Indie's code in DX now takes more memory than before and needs a gccollect. My results.. DX GL MEM TIME MEM TIME Loadanimimage -200 500 1000 1665 TAnimImage 30000 471 1000 1659 +GCCollect -200 460 No change. using... For Local a = 1 To 100 Cls For Local b = 1 To 1000 SetRotation Rand(360) blob.Draw(Rand(0,640),Rand(0,480),32,32,Rand(0,4)) ' DrawImage blob,Rand(0,640),Rand(0,480),Rand(0,4) Next Flip Next End Rem |