PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

3D PPC Graphics in Practice

Hello,

I've heard of 3d libs for the PPC like TinyGL and PocketGL in other posts and I was wondering, are 3D graphics actually practical on the PPC? What kind of performance do you guys get? Are there any good free 3D libraries? I'd like to experiment a bit, but don't know where to start and don't want to spend money on something I'll never use to make a full game.

Thanks!
You can play with PocketGL for free but can't add in your own meshes.

PocketGL is very cheap at $49 and gets impressive results. Try Mr X's demos on the post beside this one to see.

Downside is that you don't get real docs with PocketGL.

There are no other useable libraries yet but a few very basic bits of code. There seem to be a couple of people developing though so there may be something later.
First off, yes, Pocket PCs can handle very substantial 3D rendering, if the entire rendering pipeline has been specifically designed around Pocket PC hardware. Take a look at what the PS1 can do with a very well written software renderer.

I concur that PocketGL is probably your best bet. It certainly has limitations when you try to do anything substantial with it. For example, it uses a Z-Buffer, which provides the most simplistic (implementation-wise) yet accurate depth sorting. However it is also very expensive. Pierre reduced the cost of using a Z-buffer by merging the depth buffer and color buffer together. So the high word is the depth, the low word is the RGB565 color value. The big downside is it requires special GAPI blits because it isn't a plain 16 bit color buffer. If one uses an extra pass through the buffer to convert it to a regular buffer then it negates any performance gain you would get from an optimized GAPI toolkit like GapiDraw (see this thread.

Other disadvantages for large projects include:

Only imports ASE format (raw polygons), which can only really be generated by the very expensive 3D Studio Max.

No hidden surface removal (coverage spans, etc).

Limited Z-distance (4096 units for perspective correction).

Texture color depth is reduced to 9 bit before gourard shading is applied.

No entity system.

Many hard-coded values (screen dimensions, FOV, etc).

No high level polygon management (BSP). Note that the BSP implementation used by the Quake3 demo is not real BSP. It is not a tree, it it just divides the world into a grid.

Custom GAPI flush routines not optimized for newer devices (e740, Axim, etc).

No documentation, and demos are only of limited value for someone new to 3D programming in general.


It is a good toolkit to build off of. It allows one to quickly prototype off of it, but by itself it can only be used for pretty basic games, like Ghostworld. It is not possible to create a first person shooter or any high poly maps with it due to performance reasons, without a substantial amount of additional coding. But for the money it is a good investment.

Dan East
Add to that insightful comment of Dan, that if you want to make a different shading algorithm than gouroud or flat then you're gonna have some problems. You are basically limited to what PocketGL gives you in terms of rasterizer options.
The biggest problem with 3D on the Pocket PC is not performance. The problem is controls and screen space.

Controling something that is 3D on a 2D screen is always a bit tricky, but the PC has quite good controls though the mouse and keyboard, and for some games a wheel or joystick. But on the PPC you are limited to one controlling method. The stylus and d-pad. The dpad also has difficulties since many PPC:s can't handle multiple button presses (atleast not the original iPAQ) and diagonals. Here is where the issue lies, and what makes games like FPS a bit tricky (not impossible, but tricky).

Also the small screen is an issue. Small screen means things can look quite pixelated, and it can be hard to see what things in the distance really is.

And then we have the evil backlight which insists on shutting down when you are watching a cutscene...
A correction to my previous post. The combination color / depth buffer that PocketGL uses is not high word depth, low word RGB 565. The low word is a proprietary color value. The base 9 bit texture color value has another value (the intensity) added to it. When the GAPI blit occurs that value is looked up in a table, which contains the 9 bit values scaled to various intensities in RGB 565.

Dan East
on the control issue mentioned above I'm using a virtual D-Pad with a toggle to give me 10 controls but have not implemented the 8-way functionality as I also offer the read D-Pad + other hard buttons.

I'm only using a 240 x 240 3D screen to aid performance.

Overall PocketGL is pretty good & is likely to do me for this current game & the next one. Hopefully by then PocketPCs will be able to take a port of OpenGL.
Of course, the main advantage of PocketGL is that you get the full sourcecode, so if you're reasonably familiar with 3d gx, any tweaking you want to do is possible.
As Dan said, it's a great basis for your own 3d engine, but on its own it can be a quite limited.