GapiDraw vs PocketFrog - preliminary benchmark report
Hi all,
I did some work on a generic benchmark class that we can use to test our toolkits. I did some preliminary tests and the difference in performance was probably too large between PocketFrog and GapiDraw so I will ask you guys for help in checking the PocketFrog test.
Here are the bitmaps I have chosen. A typical 32x32 sprite, and a typical menu graphics bitmap in 128x128 pixels:

Color keyed sprite 32x32

Alpha map used for AlphaBltFast (not available in PocketFrog 0.6)

Color keyed menu item 128x128

Alpha map used for AlphaBltFast (not available in PocketFrog 0.6)
Here is the class I used:
http://www.sanneblad.se/johan/temp/gfxbench.h
Here are the sample projects:
http://www.sanneblad.se/johan/temp/gfxbenchgd104.zip
http://www.sanneblad.se/johan/temp/gfxbenchgd300.zip
http://www.sanneblad.se/johan/temp/gfxbenchpf060.zip
Here are the results as an XLS file:
http://www.sanneblad.se/johan/temp/gfxbench.xls
And for those of you without Excel, here is a screen snapshot:
Please, give the PocketFrog sample a go! I compiled the PocketFrog library and the Blit sample with maximum optimizations in release mode.
//Johan
I just wanted to add that all GapiDraw surfaces were stored in system memory using the flag GDSURFACE_SYSTEMMEMORY even on the Stationary PC. I figured there was no point in comparing sysmem copy to vidmem copy.
By the way.. I'm not sure how PocketFrog uses coordinates.. If I set the random coordinates using:
m_pRandTable[i] = rand() % (240-MAX_SURFACE_WIDTH+1);
And call FillRect() using Rect(x, y, x+MAX_SURFACE_WIDTH, y+MAX_SURFACE_WIDTH), will something be drawn if x and y are maxed? GapiDraw uses rectangles that are exclusive, which means that they will be drawn using this formula ("width" equals "right-left", not "right-left+1"). Does PF this also? If PF does not, then performance for PF on FillRect should probably be somewhat slower.
One might wonder why GD104 performs better than GD300 in so many cases
Pejo Software - Per wrote:One might wonder why GD104 performs better than GD300 in so many cases
Yeah I was wondering the same thing.
Johan wrote:By the way.. I'm not sure how PocketFrog uses coordinates.. If I set the random coordinates using:
PF uses the same convention (which "happens" to be the same one as Windows).
One might wonder why GD104 performs better than GD300 in so many cases. Yeah I was wondering the same thing
Well, we do support more than one platform now as you both probably know..

We had to make some changes to the code to:
1. Make it work on Symbian and Palm
2. Improve performance for non-hardware-accelerated operations on Stationary PCs
3. Keep the DLL in an acceptable size
I think we came up with excellent performance in most cases.
Well, one thing... isn't it true that the version of PF you used is using GDI on the desktop vs. DX for GD? I only point it out because if true, I would say that whole set of results is irrelevant since it would be apples to oranges. The rest seems apples to apples though.
Well, one thing... isn't it true that the version of PF you used is using GDI on the desktop vs. DX for GD? I only point it out because if true, I would say that whole set of results is irrelevant since it would be apples to oranges. The rest seems apples to apples though.
As I said previously, the only thing that is measured in the test is RAW memory buffer -> memory buffer copy using the library blit and fillrect tools. There is no copying to display involved. All tests are done before the first Update() / Flip() is performed. Please take a look at the samples I have posted above. I have numerous optimizations in the stationary version of GapiDraw not available in the PPC one, and vice versa...
Johan, the test results made me think that shouldn't I supposed to be using GD v1.04 on my PPC games and GD v3.0 on my ports instead?

My games could sure use the extra milliseconds.
Yeah, it's kind of ironic that if you want to use GD, you automatically have to use a worse product, if your just considering PocketPC performance. Since VI won't give a new license for anything other than 3.0, it's not an option.
fzammetti wrote:Yeah, it's kind of ironic that if you want to use GD, you automatically have to use a worse product, if your just considering PocketPC performance. Since VI won't give a new license for anything other than 3.0, it's not an option.
I don't understand why you can't get a license under the current terms for 2.0. If you want to use a lower version, it should be up to you, not them.
.. but this is a discussion for the GapiDraw forums. Perhaps someone should create a similar thread over there.
Somebody probably should start such a thread, but I felt compelled to reply here anyway... I was told point-blank that licenses for versions lower than 3.0 WILL NO LONGER be given out, period. No NEW licenses anyway. I won't say anything else here, but if someone else starts a thread somewhere and asks for my input, I'll be more than happy to offer it.
As I see it, there's evidently room for an alternative to GapiDraw.
Taking PocketFrog out of retirement, defining long term goals, including optional PocketHal support and making it officially an OpenSource project would definately be a big plus. We could all contribute our small effort to it.
Everyone would benefit from this, including GapiDraw users since there would be competition. The only person that would NOT benefit from this would probably be the poor sap maintaining the project, as people might simply run away with the code and not report bugs or improvements... But maybe that's just my dark side talking.
For those of us that cannot [ or will not, or don't want to] purchase a license for GapiDraw would we be screwed if it wasn't of Thierry's work, or what!
Getting Gapi/direct chip support into a library to the point where it works on all platforms must be such a nightmare...
--Eric
I believe Thierry originally stopped working on pocket frog since soo many people were using it and modifying the source, but there were not many contributions. I think this is why pockethal is in a lib form.
Would it be possible to make a new pocketfrog sort of plugin manager where as a few people could work together creating modules such as a fast blitter and then release it in a lib that linked into this new platform. This way small teams could work on different parts and add to the project without giving away proprietary code(if they were worried about it).
That's pretty much what I assumed about the PF development. If you find a bug in the source you fix it. If you find one in a .LIB, you report it and twist in your chair until it get fixed.
--Eric
Some like me are really screwed.
I would like to continue using GapiDraw but VI considers me a professional and I can't afford the huge price. They won't let me use the older versions and they won't let me pay the lower prices.
PF is somewhat derelict, and doesn't have full-time support, testing, or development. That makes it risky.
Publishing through another publisher who can afford the GapiDraw license fee is an option, but then I lose royalties.
Writing my own library is an option, but that's another big investment that just won't pay off for me at this time.
So basically, I'm not a hobbyist doing this in my spare time. I'm trying to start a business doing this, to make enough money to pay the bills, because otherwise I have to go out and get a Real Job, which unfortunately involves selling a house and moving to another city.
I'd love to work on libraries like PocketFrog, but right now my focus has to be on making game products that I can sell. Even if I ultimately end up successful, it's going to be hard.
So at this time, what I need is a library that works that I can use. It has to have the features I need, be tested to run on the devices I support, have bugs fixed when they are discovered, have enough performance to play my games, and not cost me a fee I can't pay right now.
I know, I'm being greedy and asking too much. :-)
That's just the situation I'm in now. Next year, if I've moved and acquired a day job, maybe I can do something with PocketFrog in the evenings to relax. But right now I can't spend my time that way. Hopefully someone else can, though, since it has potential.
Your not being greedy, but you ARE overlooking the obvious answer: PocketFrog!
Not the forthcoming PHAL-based version, but the last non-PHAL version.
It has all the benefits you want: free, bugs can be addressed (by you admittedly, but you have the FULL source, there's no hidden parts like there will be with PHAL or GD entirely, so it counts I think), it has been tested on a large number of devices, it has most of the features of GD, probably not many you'd miss anyway, and it has some of it's own the GD doesn't have, and it's performance is probably sufficient for most games.
You and I have talked, and we're in much the same boat, except that I'm NOT trying to make a living from my PocketPC endeavors, just a little extra cash on the side. That may change down the road, but not in the forseeable future. That being said, GD is no longer an option for me, plain and simple. They have quite effectively priced people like us out of their market. It's a real shame, but that's the way it is.
I would feel a lot worse though if I didn't know there was a good alternative out there, and PF is it. I can't wait for the new release, whenever that arrives, because my understanding is it will address most if not all of my long-standing concerns. But even if it never gets released, I'm coming back to PF almost for certain. Maybe if VI decides to agree that I am hobbyist it might make a difference, but I have other concerns with them that are even more grave then the pricing, so probably not.
I will have no problem tossing some money Theirry's way when my games are selling (I could send him something because Invasion: Trivia was PF-based, but to be honest, the cost of postage would be more than he'd get, hopefully that's not the case next time). PF is more than an alternative, it's a darned good one, and that's WITHOUT PHAL, which should make the matter even better (although the trade-off is not having complete access to the source, but the benefits outweigh that I think).
The main concern I have with PF is compatibility and testing.
It's not enough to say that it has been tested on a lot of devices. Without dedicated support, I think people in my boat (business not hobby) need to see a list of exactly which devices PF has been tested on, and shown to be working correctly.
What we need is a demo that puts PF though a lot of hoops, that can be run on a lot of devices, and the results put up on one page. Obviously this requires work, to organize the effort and maintain the page, and to do the actual testing on the devices.
I'm still hoping there is hope for using GapiDraw. I took a look at the FMOD licensing upon which the new GapiDraw licensing is supposedly inspired, and they seem to have room for people like me. Their lower-priced license is called "hobbyist/shareware" and is available to small, 1-person efforts who sell through the web only at a lower price point as shareware. That's me. So I'm hoping VI will also see it this way. FMOD would give me a $250 site license to use their product, and that's totally reasonable for GapiDraw too, given my ability to pay at the moment. I'm just not a large company that can be charged a lot of money and produce revenue to recoup it.
Well, I for one have very little hope for using GD in the future based on everything I've heard thus far, but I AM still awaiting word back from Shahab before I can know for certain. We'll see...
Send another mail he likely didn't get yours with the recent move/worm problems.
Definately resend any messages you have for Shahab. I had to resend several times before getting a response back due to their server outage.
Can we keep GD licensing issues in the GD forum?
Thank you.
Hello Johan,
I was away from the computer during the last two days, I'll try to compile a bench and post the exe and my results here.
But to start I need the results of your bench on my current device (ipaq 3760), I've downloaded your sample, but it simply don't run ("minimal is not a valid pocketpc application"), same pb with the pc version (crash).
Is there a pb with the compiler you use ? Maybe you aren't supporting non xscale devices ?
I think there is still a lot of StrongARM devices out there, so we need to make our bench compatibles with both StrongARM and XScale.
Last question : BltFast without colorkeying is just a blit of a rectangular surface isn't it ?
StephC: Um. You need the "minimal.exe" and "gd300.dll" in the same folder. You also need gx.dll installed on the device. The file should run on any ARM Pocket PC. The Stationary PC version requires that you have DirectX 7.0 or later installed.
BltFast without colorkeying is just a blit of a rectangular surface isn't it
Yep..
Okay, it works now with the last dll...
I don't understand why the OS do not report that something is missing...
I've performed a small part of the bench so far, here are the first results I get :
GD (best results with 90 degrees counter clockwise rotation) :
BltFastColorkey 32x32, 320, ms
BltFastColorkey 32x32 with 50% opacity, 484, ms
BltFastColorkey 32x32 with 10% opacity, 915, ms
FillRect 32x32, 269, ms
FillRect 32x32 with 50% opacity, 350, ms
FillRect 32x32 with 10% opacity, 1006, ms
FillRect 128x128, 3786, ms
FillRect 128x128 with 50% opacity, 3437, ms
FillRect 128x128 with 10% opacity, 13564, ms
uEngine (int13) (rotation does not affect performances) :
BltFastColorkey 32x32, 87, ms
BltFastColorkey 32x32 with 50% opacity, 398, ms
BltFastColorkey 32x32 with 10% opacity, 395, ms
FillRect 32x32, 438, ms
FillRect 32x32 with 50% opacity, 498, ms
FillRect 32x32 with 10% opacity, 498, ms
FillRect 128x128, 7146, ms
FillRect 128x128 with 50% opacity, 7768, ms
FillRect 128x128 with 10% opacity, 7788, ms
So, I'll rework my fillrect without opacity, it was a very naive implementation (a simple loop), I never used this function in a game.
I'll also add a special 50% opacity optimisation (could be much faster), but I don't think it will be useful for the game performances.
As soon as the bench is complete I'll post the exe (and the source code) here, so we will be able to compare performances on each devices.
StephC are you using RLE for your blitting?
Pejo Software - Per wrote:StephC are you using RLE for your blitting?
RLE rulez ! (yes my system is based on RLE)
May I suggest that this thread and the others like it, comparing the libraries, belong in the General Developer Discussion, rather than in the GD or PF forums.
Pam
If alphablit is not available in PF and is still present, I think we should have some pixel shader tests also present.
And if "copying to display" is not involved then I think we should have another benchmark session comparing PHAL performance with both GD versions in that area.
Here is a zip containing the ppc version, source code of the bench itself (without the source code of uEngine) and the data used will be contained in other zip (max size is 256KB).
I've used two different sprites for the 32*32 alphablit test and for the 128*128 colorkeyed test, those are from real games.
Please run the little prog on your device and report the results here (with the device and OS version), se we can compare apple with apple.
Note : to run the ppc version you need to copy all the files in the ppc directory, gx.dll, zlib.dll, data.pak and uengine_bench.exe
Thanks you in advance.
Source code and data :
uEngine init...
Platform : Unknown/WinCE
Vendor Sring ID : hp iPAQ h1940
Screen orientation : default (portait)
Dithering : default (16bits)
Load uEngine settings
settings.ue does not exist : Loading default settings
game start : loading...
---------------------------
uEngine 2D benchmark v1.0
---------------------------
>> Init
archive name set to \My Documents\ppc\data.pak
uncompress file : sprite32x32.tga 19ms
BigBuffer usage : 1 of 1024 KBytes 99 percents free
ZBuffer usage : 935 of 1024 KBytes 8 percents free
load 1 sprites : sprite32x32.tga idx : 10 to 10 1ms
uncompress file : sprite32x32alpha.tga [cached] 0ms
BigBuffer usage : 3 of 1024 KBytes 99 percents free
ZBuffer usage : 935 of 1024 KBytes 8 percents free
load 1 sprites : sprite32x32alpha.tga idx : 12 to 12 1ms
uncompress file : sprite128x128.tga [cached] 1ms
BigBuffer usage : 18 of 1024 KBytes 98 percents free
ZBuffer usage : 935 of 1024 KBytes 8 percents free
load 1 sprites : sprite128x128.tga idx : 11 to 11 13ms
uncompress file : sprite128x128alpha.tga [cached] 0ms
BigBuffer usage : 50 of 1024 KBytes 95 percents free
ZBuffer usage : 935 of 1024 KBytes 8 percents free
load 1 sprites : sprite128x128alpha.tga idx : 13 to 13 15ms
>> Ready
---------------------------
Press any key to start...
---------------------------
BltFastColorkey 32x32 : 51 ms
BltFastColorkey 32x32 50% opacity : 365 ms
BltFastColorkey 32x32 10% opacity : 354 ms
BltFastColorkey 128x128 : 445 ms
BltFastColorkey 128x128 50% opacity : 4451 ms
BltFastColorkey 128x128 10% opacity : 4451 ms
AlphaBltFast 32x32 : 200 ms
AlphaBltFast 128x128 : 5029
FillRect 32x32 : 65 ms
FillRect 32x32 50% opacity : 170 ms
FillRect 32x32 10% opacity : 442 ms
FillRect 128x128 : 896 ms
FillRect 128x128 50% opacity : 2829 ms
FillRect 128x128 10% opacity : 7151 ms
---------------------------
Bench complete !
---------------------------
Press any key to exit...
game exit
Hello!
uEngine init...
Platform :
Dell Axim X5/WinCE
Screen orientation : portrait
Dithering : 16bits
Load uEngine settings
game start : loading...
---------------------------
uEngine 2D benchmark v1.0
---------------------------
>> Init
archive name set to \ppc\data.pak
uncompress file : sprite32x32.tga 45ms
BigBuffer usage : 1 of 1024 KBytes 99 percents free
ZBuffer usage : 935 of 1024 KBytes 8 percents free
load 1 sprites : sprite32x32.tga idx : 10 to 10 3ms
uncompress file : sprite32x32alpha.tga [cached] 0ms
BigBuffer usage : 3 of 1024 KBytes 99 percents free
ZBuffer usage : 935 of 1024 KBytes 8 percents free
load 1 sprites : sprite32x32alpha.tga idx : 12 to 12 1ms
uncompress file : sprite128x128.tga [cached] 0ms
BigBuffer usage : 18 of 1024 KBytes 98 percents free
ZBuffer usage : 935 of 1024 KBytes 8 percents free
load 1 sprites : sprite128x128.tga idx : 11 to 11 17ms
uncompress file : sprite128x128alpha.tga [cached] 0ms
BigBuffer usage : 50 of 1024 KBytes 95 percents free
ZBuffer usage : 935 of 1024 KBytes 8 percents free
load 1 sprites : sprite128x128alpha.tga idx : 13 to 13 20ms
>> Ready
---------------------------
Press any key to start...
---------------------------
BltFastColorkey 32x32 :
81 ms
BltFastColorkey 32x32 50% opacity :
407 ms
BltFastColorkey 32x32 10% opacity :
400 ms
BltFastColorkey 128x128 :
1073 ms
BltFastColorkey 128x128 50% opacity :
5555 ms
BltFastColorkey 128x128 10% opacity :
5554 ms
AlphaBltFast 32x32 :
227 ms
AlphaBltFast 128x128 :
6933
FillRect 32x32 :
69 ms
FillRect 32x32 50% opacity :
156 ms
FillRect 32x32 10% opacity :
469 ms
FillRect 128x128 :
1098 ms
FillRect 128x128 50% opacity :
3845 ms
FillRect 128x128 10% opacity :
8967 ms
---------------------------
Bench complete !
---------------------------
Press any key to exit...
game exit
@ bientot

,
Joshu.
HTK: A comparison on the final blit to display is not really necessary, GapiDraw uses GAPI on the PocketPC, and Thierry already provided benchmarks on that.
StephC: Thanks for the post. I will get back to implementing that CGapiRLESurface....

"guest" was me, on the ipaq 1945 benchmark results
I got results of the uEngine bench on a 2215 thanks to a friend.
I've summarized the difference with GD30 here :
BltFastColorkey 32x32 :
GD30 : 141 ms
uEngine : 41 ms
difference : 244% faster
BltFastColorkey 32x32 50% opacity :
GD30 : 227 ms
uEngine : 218 ms
difference : 4% faster
BltFastColorkey 32x32 10% opacity :
GD30 : 469 ms
uEngine : 217 ms
difference : 116% faster
BltFastColorkey 128x128 :
GD30 : 4177 ms
uEngine : 403 ms
(not the same data)
BltFastColorkey 128x128 50% opacity :
6742 ms 3374 ms
(not the same data)
BltFastColorkey 128x128 10% opacity :
11319 ms 3376 ms
(not the same data)
AlphaBltFast 32x32 :
473 ms 134 ms
(not the same data)
AlphaBltFast 128x128 :
GD30 : 10526 ms
uEngine : 4272 ms
difference : 146% faster
FillRect 32x32 :
GD30 : 50 ms
uEngine : 42 ms
difference : 19% faster
FillRect 32x32 50% opacity :
GD30 : 166 ms
uEngine : 96 ms
difference : 73% faster
FillRect 32x32 10% opacity :
GD30 : 551 ms
uEngine : 254 ms
difference : 117% faster
FillRect 128x128 :
GD30 : 505 ms
uEngine : 515 ms
difference : 2% slower
FillRect 128x128 50% opacity :
GD30 : 3010 ms
uEngine : 2416 ms
difference : 25% faster
FillRect 128x128 10% opacity :
GD30 : 9113 ms
uEngine : 5453 ms
difference : 67% faster
StephC: Can you please post the new bitmaps you used in your examples? You said you changed them...
Johan wrote:StephC: Can you please post the new bitmaps you used in your examples? You said you changed them...
Already posted them (bench_uengine_data.zip).
They are in tga format (with alpha channel in the same file as the image).
I don't see why you are using alpha channel as a separate surface... (png support alpha channel too).
Stephc:
I too was wondering about merits of using Alpha as a separate surface but no longer.
In fact in my latest gfx library I support both - built in and external alpha - sometimes you can have multiple set of images with the same underlying alpha channel. Having option to use external Alpha surface will let you store it only once instead of having copy of the same alpha attached to each image.
warmi wrote:Stephc:
I too was wondering about merits of using Alpha as a separate surface but no longer.
In fact in my latest gfx library I support both - built in and external alpha - sometimes you can have multiple set of images with the same underlying alpha channel. Having option to use external Alpha surface will let you store it only once instead of having copy of the same alpha attached to each image.
Never encountered this case.
Here is my list of priorities concerning uEngine :
1/ speed
2/ ease of use
3/ size
I think that the external alpha plane is a quite small gain in size (for special cases) and a negative point for the ease of use.
Remember it is an option.
I have a class that defines a surface where alpha is an optional parameter ( you can disregard alpha when loading from TGA file).
I also have two alphaBlits - one takes an external alpha surface and the other will act on internal alpha if the surface has it defined.
Best of both worlds.
StephC: Thanks a lot for the benchmarks! Really! We'll add an RLE class to the next release of GapiDraw, and now we have something good to benchmark the performance against..

Thanks!
With uEngine you never have to deal with alpha channel or surfaces..
1/ you ask uEngine to load a sprite (you don't care if it's alpha or colorkey)
2/ you display it
no class, no surfaces, not even pointers..
As a game programmer I only want to have an efficient way to load and display my sprite at a given coordinate.
Johan wrote:StephC: Thanks a lot for the benchmarks! Really! We'll add an RLE class to the next release of GapiDraw
Good luck

/ you ask uEngine to load a sprite (you don't care if it's alpha or colorkey)
2/ you display it
no class, no surfaces, not even pointers..
Well, makes sense. Then again, what do you do when you have some sort of sprites that can be created or modified in real time programmatically ?
What do you do when you want to write a custom blitter that only makes sense in a particular game and will speed up rendering tremendously compared to default blitters provided in your sprite class but you need access to pixels and alpha information ?
I personally prefer a basic graphic subsystem (dealing with surfaces, alphas etc) on top of which, I create various sprite engines etc which are custom fitted for the game but hey ... there were many ways to skin a cat :-)
warmi wrote:
Well, makes sense. Then again, what do you do when you have some sort of sprites that can be created or modified in real time programmatically ?
You mean rotation scaling and tint ?
uEngine provide many transformations at loading time and in real time.
If someone need a functionality that is not provided, I simply add it.
In it's current version uEngine provide more transformations than GD, for example Additive Blending (not alpha), which is a very useful effect.
What do you do when you want to write a custom blitter that only makes sense in a particular game and will speed up rendering tremendously compared to default blitters provided in your sprite class but you need access to pixels and alpha information ?
Never happen
I've attached an image to illustrate additive blending.

uEngine

HTK wrote:And if "copying to display" is not involved then I think we should have another benchmark session comparing PHAL performance with both GD versions in that area.
Yes, this should be added. I'll probably convert GD's moving sprite demo to PocketFrog once it is integrated with PHAL (I know, I know... hopefully this weekend).
StephC:
Was the meteor image basically a sprite displayed multiple times in succession using additive blending with the standard blit at the end (top of the stack) or is there some other trick to get this effect ?
It looks pretty cool.
I think I could get the same effect using alpha-blending but I guess additive blit is cheaper ....
warmi wrote:StephC:
Was the meteor image basically a sprite displayed multiple times in succession using additive blending with the standard blit at the end (top of the stack) or is there some other trick to get this effect ?
Yes, you guessed it, and the sprites are not blended with the same blending factor...
It looks pretty cool.
I think I could get the same effect using alpha-blending but I guess additive blit is cheaper ....
No, I don't think you'll get the same effect with alpha blending, and no, additive blending is not much cheaper.
I spent more time optimizing additive blending than alpha blending....
StephC:
1) About your RLE sprites... Are you compressing them at load time or are you using RLE-TGAs?
2) About your surfaces with alpha: are you storing them in 8888, 4444 or some other format? 8:5:6:5?
Thierry wrote:StephC:
1) About your RLE sprites... Are you compressing them at load time or are you using RLE-TGAs?
I do not use RLE TGA but I "compress" the sprites at load time.
2) About your surfaces with alpha: are you storing them in 8888, 4444 or some other format? 8:5:6:5?
The alpha channel is embedded in the RLE stream.
The pixels are stored in the classic 565 format, and alpha in a single byte (when needed)
Thierry wrote:(I know, I know... hopefully this weekend).
great! monday 9th 00:01am I´ll start a thread asking about the new PF/PHAL!
just kidding

addictive blending may be considered similar to alpha, but it is better for effects that involve light, like explosions,flamethrowers,sparks...
HTK wrote:addictive blending may be considered similar to alpha, but it is better for effects that involve light, like explosions,flamethrowers,sparks...
And so is a must have for any commercial grade graphic toolkit

Or you may have something like "pixel shaders" and do all those things by yourself

( and much more! )
Is uEngine ever going to be public?
Also..... No offense to your new picture, but I just wanted to comment that I liked your frog avitar better :) .
HTK im going to stay away from your "addictive" blending, for some reason I dont think it would be good for me.
DillRye wrote:Is uEngine ever going to be public?
Maybe

HTK wrote:Or you may have something like "pixel shaders" and do all those things by yourself

( and much more! )
Yes indeed. Pixel shaders are one of the greatest features of PF in my opinion.
Additive Blending Pixel Shader
- Code:
struct AddShader : public PixelShader
{
Pixel operator()( Pixel src, Pixel dest ) const
{
register unsigned int tdest = 0;
register unsigned int t;
t = (src & RED_MASK) + (dest & RED_MASK);
if(t > RED_MASK) t = RED_MASK;
tdest |= t;
t = (src & GREEN_MASK) + (dest & GREEN_MASK);
if(t > GREEN_MASK) t = GREEN_MASK;
tdest |= t;
t = (src & BLUE_MASK) + (dest & BLUE_MASK);
if(t > BLUE_MASK) t = BLUE_MASK;
tdest |= t;
return ((Pixel)tdest);
}
};
Pam
Pixel Shaders as implemented in PocketFrog are IMHO nice for some stuff, but definitely not for real-time additive blending.. Remember that a virtual function call has to be made for EVERY PIXEL you pass through the pixel shader = sloooooow....

DillRye wrote:
HTK im going to stay away from your "addictive" blending, for some reason I dont think it would be good for me.
LOL!
sorry for my terrible english, I don´t want nobody addicted to any pixel stuff, I know a lot of you guys already drink coffee all day, one addiction is enough!
I doubt this "Additive Blending Pixel Shader" from PF is what fro example StephC is using.
While it does do what is commonly described as additive blending , it is rather simplistic and doesn't account for things like blending factor which are neccesary if you want to make sure that your code works in every possible case ( combinations of different backgrouns etc..)
Johan wrote:Pixel Shaders as implemented in PocketFrog are IMHO nice for some stuff, but definitely not for real-time additive blending.. Remember that a virtual function call has to be made for EVERY PIXEL you pass through the pixel shader = sloooooow.... :)
I don't see how a nice feature, even "slow", can be worst then not having the said feature.
It has a nice tradeoff between flexibility and performances. As far as I know, you can't even define your own shaders in GapiDraw. You are totally dependant on what the developers decide to put in. In PF, you can add your own shaders. If more speed is needed, then you should definitely optimize the piece of code that you need. A good example of this is the Alpha-Blending shader (no virtual call there).
I completely agree with you Therry.
Frankly, I am not so hot about pixel shaders done in software but your decision to go with unrotated buffer in HAL was brilliant.
At this point there is no way to add your own custom blitter in GapiDraw without having to mess around with different screen orientations etc which make things much more difficult.
How many types of shaders are needed ?
I there so much that we can't provide them hardwired in the graphic toolkit ?
StephC wrote:How many types of shaders are needed ?
I there so much that we can't provide them hardwired in the graphic toolkit ?
Shaders will be seriously reworked to make sure that:
1) No function is called per pixel.
2) Multiple pixels are worked on at the same time.
This won't be in the next release, but is definitely on my list to be done for 1.0.
It is not so much the shaders but rather custom blitters.
Things like Z order/span based sprite rendering etc. The ability to manipulate pixels on your own without any sort of speed penalty is essential in anything but the most trivial 2d games ( not to mention 3d but there everything changes anyway.)
One plus on the side of PF as far as the pixel shaders goes is that having full access to the source, you can of course integrate your shaders, just like the alpha blending shader is now, to avoid the virtual function call per pixel.
With GD, even if you could define your own shaders, not having source would remove the possibility of integration at a lower level (unless Johan is even more clever than we know he is!

)
Johan wrote:Pixel Shaders as implemented in PocketFrog are IMHO nice for some stuff, but definitely not for real-time additive blending.. Remember that a virtual function call has to be made for EVERY PIXEL you pass through the pixel shader = sloooooow....

Well, they are fast enough for what I needed. With GapiDraw I would have had to write my own blit routine.
Pam
warmi wrote:It is not so much the shaders but rather custom blitters.
Things like Z order/span based sprite rendering etc. The ability to manipulate pixels on your own without any sort of speed penalty is essential in anything but the most trivial 2d games ( not to mention 3d but there everything changes anyway.)
Games written for the GBA are using the hardware blitter for almost anything that is displayed, and I don't see those games suffering too much by the lack of per pixel control.
Well, you just answered your own question. :-)
Creating custom blit is generally done in an effort to squeeze a bit more performance out of whatever machine you are working on.
If one has access to hardware supported blits then the whole thing becomes a bit pointless since you generally won't be able to outperform hardware no matter how optimized your code is ( that last remark doesn't apply to ATI Pocket PC chipsets..)
But the bottom line is, why don't give people this option ?
Flexibility like that is what makes for a sucesfull toolkit.
warmi wrote:
But the bottom line is, why don't give people this option ?
Abstraction & Encapsulation are more important than flexibility in my mind.
I want my graphic layer to react as if it was hardwired.
StephC wrote:Abstraction & Encapsulation are more important than flexibility in my mind.
I do not agree with this at all. Abstraction & encapsulation are tools, not an end in themselves. Flexibility is far more important in software development.
StephC wrote:I want my graphic layer to react as if it was hardwired.
*Icks!*
Thierry wrote: Abstraction & encapsulation are tools, not an end in themselves. Flexibility is far more important in software development.
Abstraction & Encapsulation are design rules, and Flexibility a feature.
Problem is : the flexibility feature often break the abstraction & encapsulation rules.
Couldn't you say that abstraction leads to flexibility? Of course, it depends on what Thierry means when he says flexible.
"Program to an interface, not an implementation."
"Favor object composition over class inheritance."
Design Patterns - by GoF.
I think this passage from The Mythical Man-Month put it best;
"I will contend that conceptual integrity is
the most important consideration in system design. It is better to have a system omit certain anomalous features and improvements, but to reflect one set of design ideas, than to have one that contains many good but independant and uncoordinated ideas."
But heck, what do I know, I'm just a newb here.

= sloooooow....
I started writing my own graphics library (for PPC only) since GD licensing issues arise. I'm using JHarbour's book sample codes to start with and based the framework on GD and PF. As of this moment, I doing a great progress. And I might be able to release a demo in a week of two.
Since I'm writing this for fun in C/C++, and not in ASM, someone might say this library is SLOW and POOR in performance. But, I don't care as long as I can use it in creating games. And the basic features needed will be present in this library.
The BATTLE between GD and PF is interesting, and I feel insecure with my gfx library

denthorq wrote:I started writing my own graphics library (for PPC only) since GD licensing issues arise. I'm using JHarbour's book sample codes to start with and based the framework on GD and PF.
Awesome! Jonathan Harbour's book is also what gave me the idea of starting PocketFrog!
denthorq wrote:As of this moment, I doing a great progress. And I might be able to release a demo in a week of two.
Looking forward to it!
denthorq wrote:I started writing my own graphics library (for PPC only) since GD licensing issues arise. I'm using JHarbour's book sample codes to start with and based the framework on GD and PF. As of this moment, I doing a great progress. And I might be able to release a demo in a week of two.
It's nice to know people started working on their own library project. Maybe in the end it will benefit us all.
I've also been doing the same. I've abstracted the framebuffer access to use PHAL or whatever else I may end up using. For example, if a GAPI-only access library was made, I could simply put support for that in.
I've also added support for a console graphic library since I'm targetting that too. If I'm compiling for that console, my blits are replaced by the console gfx library, providing me with transparent transition between systems and acceleration the console provides.
Honnestly, I'm having a really fun time making both out game and the library. Thierry has done great work with PHAL, and it really is an amazing product even at version 0.5!
The BATTLE between GD and PF is interesting, and I feel insecure with my gfx library

Dont! There's always going to be better products, and improvements to other tools. Once you build up your library with the functionality you require, test it then optimize it.
You may probably end up with a library better suited to your needs, and will be able to fine-tune it
ad infinitum. But I guess it all depends on the time you plan to invest in that project, versus others.
--Eric
just a thought... i think its probably not proper to compare gapdidraw & pocketfrog. since pocketfrog is several months old already. pockethal is really fast, but it gives only an access to the framebuffer. maybe we should wait a few more weeks as thierry is still integrating phal and pfrog.
i also read in posts that a some people have use pockethal in their 3d engines and claim (with numbers) that its faster than gapidraw.
It makes no sense to compare PHAL to gapidraw (or PF) like that. The only thing you can rightfully compare PHAL to would be GAPI.
On the other hand, compariing PF and GapiDraw is fair. Their intended purposes are roughly the same; and it looks like GD has the better blit functions right now, but that gap will probably start narrowing.
GD has the out of the "box" performance crown right now, but I don't think GD is going to have the performance crown on PPCs for long. In real world games; PHAL translates into at least a 5-20% boost in FPS on the vast majority of devices. Hell, I think Thierry even managed to boost performance on those mediaQ bitches in certain situations.
Once PF improves its blits a little, even if GD's are still a little better, the PHAL boost is going to push it over GD performance-wise (that might not even take improved blits if you stay away from transparencies and whatnot).
izeman wrote:i also read in posts that a some people have use pockethal in their 3d engines and claim (with numbers) that its faster than gapidraw.
When I changed my yeti port to use phal instead of gapidraw I got a large increase in fps (can't remember how much but it was impressive).
However in most cases it is not relevant to directly compare the 2. PHal is much faster for frameswapping (and gives me a non rotated framebuffer) but this is only a small part of the gd framework. At the moment, it would still be faster for me to do a 3d game in gd because it supports text etc.
Of course the pf+phal combo would be perfect... I can't wait to have a play (Thierry, if you are reading this, DONT! Go back to programming. There is time for reading when the programming is done!

)
Sean
I was wondering if PocketFrog also uses only the Y pitch like PocketHAL and unlike GapiDraw, and if it also uses non-rotated surfaces again like PHAL and unlike GD (I think).
It's a lot easier to use non-rotated surfaces and using a single pitch.
--Eric