PocketMatrix forums

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

OpenGL ES API Spec Released

http://www.khronos.org/opengles/spec.html

I would expect a number of announcements this week at SIGGRAPH related to this. From software implementations to hardware support.
the second post's mention of Microsoft's 3D plans is just as interesting as the OpenGL ES stuff
Yeah, those MS comments are to me even more interesting... They talk about Direct3D Mobile, and that's great, but are they going to also do DirectDraw Mobile? Or is Direct3D Mobile something that you would use on top of something like GapiDraw? I can't imagine MS doing that, but who knows?
I would stick with OpenGL ES. The big hardware manufacturers are behind it 100%. Take a look at who drafted the OpenGL ES specification and who he works for. Certain people already have access to the hardware prototypes that OpenGL ES was created to interface with.

Dan East
Just an FYI, one of the biggest differences with OpenGL ES is that the glBegin / glEnd paradigm is not available. All drawing is done via vertex arrays or vertex index arrays (glDrawArrays / glDrawElements). Some additional support for fixed point types has been added. Many reduntant functions supporting different arguments have been removed (for example, glColor3 is not available, just use glColor4 instead).

Dan East
If I'm following this correctly OpenGL ES is a specification only at this point. There are no working engines & no indication if these will be available to independant developers when they do appear. The header file exists to show calling of functions but that's all.

I also get the impression that it's mainly aimed at smart phones rather than PDA's.
as far as i know is fathammer involved in producing an opengl|es compatible renderer. but until now fathammer was only aiming at the professional gaming market (25k$ per game title). i'd like to know how much an opengl|es renderer would cost...

nevertheless, i'm (since needed for my work on mobile augmented reality) working on an opengl subset for PDAs. it currently has it's own subset definition since opengl|es was not public until now.

i'll dig into the opengl|es specs and see how much work it will be to comply to it.

if you want more infos on it look at:
http://www.ims.tuwien.ac.at/research/ha ... softgl.php

DANIEL
Hello Daniel, I was not aware of your SoftGL project until now. I will be interested to see what you make of the OpenGL ES specs / SoftGL. Currently I'm using PocketGL.
PocketGL is very nice and definitely better when it comes to texturing and games suppport.

before i started my work on SoftGL i investigated PocketGL and found out that it didn't suite our needs because of the indexed color buffer and the strange fix-point notation it uses.
besides that it can not use arbitrary projection matices (we need off-axis projection).

if it is not too much work i'll certainly try make SoftGL compatible to the OpenGL|ES specs...

DANIEL
SoftGL looks interesting. Will it be available for download? :)
SoftGL looks interesting. Will it be available for download?


it will surely be downloadable including the full source code at some time. the problem is that we don't know yet when this will be (maybe end of the year or so...)

DANIEL
Please please please could some of the people involved in these mobile devices just give us a simple 'WaitForVBlank()' function!!

It's shameful that so many mobile devices have been released without exposing such simple but essential (for game developers) functionality (Anyone know if the NGage has it? Nokia Series 60 doesn't....)

What's the point of nice 3D libs if everything will still look like a steaming pile of poo due to flicker/tearing?...
Had a very quick look at the OpenGL:ES spec, and it seems to still be depth-buffer based :(

I wouldn't expect software implementations of it to be very fast...

It's a shame they didn't include a bucket-sorting mode, to sort polys 'the PSX way'. Although it can't handle polys that intersect, it can be far faster than depth-buffering, much more suited to software implementations as it saves a shedload of memory bandwidth
Depth buffer is implementation specific. The API supports it, but that does not mean it must be implemented, for software or hardware implementations. Hint hint.

Dan East
I wouldn't expect software implementations of it to be very fast...


i don't see the big problem with z-buffers.
my softgl renderer uses z-buffer and it's still quite fast (using shading, but we are not talking about texturing here).

the problem with alternative methods is often that they reduce flexibility. of course people expect opengl|es to work similiary to std opengl.

i don't know this bucket sorting. how does it work?

DANIEL
drgoldie wrote:
I wouldn't expect software implementations of it to be very fast...


i don't see the big problem with z-buffers.
my softgl renderer uses z-buffer and it's still quite fast (using shading, but we are not talking about texturing here).

the problem with alternative methods is often that they reduce flexibility. of course people expect opengl|es to work similiary to std opengl.

i don't know this bucket sorting. how does it work?

DANIEL


I've never heard of "bucket sorting", but as they say it's the way psx uses to sort polygons, I suppose bucket sorting is what I know by Ordering Table sorting ;)

there's a good article explaining it:
http://www.gamedev.net/reference/articl ... cle675.asp

however I agree, z buffering is faster than you'd expect. I tried both ordering table and z buffer methods in a 3D engine and I was very impressed with z buffer performance, however I expected a lot more from the ordering table.

I suppose it's a matter of cache, having a zbuffer you can sort objects/polys so that the ones with the same texture are rendered one after another, however in an ordering table you are (probably) rendering polys from different objects & textures, trashing cache every triangle you render (of course this happens only when two objects are too near, but this happens often)

Regards :)
Kak
I like "radix sorts" myself (when the data "fits" at least) - really they're similar or the same as "bucket sorts", depending on who you talk to.

Rather amusingly a googled link provided <a href="http://www.cubic.org/~submissive/sourcerer/radix.htm">this</a>... written by somebody who "appeared" in another thread when something else he wrote was mentioned. :D
i digged through the article and it turns out that it's simply a hashtable for polygons using the z-value as index.

i can immediately find examples where this method will fail. while this is ok for game developers on the psx (they can always split polys to fit the method) opengl developers will want their programs behave the way they are used to it.

z-buffer might not be the fastest method for software rendering, but it is one of the most powerfull. one of the few problems it has is transparent polygons (including antialiazed edges).
but a renderer can be speed-up e.g. by using hierarchical z-buffer.

btw: who said that it has to be done in software. there are quite some 3d chips for mobile devices on their way into the market...

DANIEL
drgoldie wrote:
i can immediately find examples where this method will fail. while this is ok for game developers on the psx (they can always split polys to fit the method) opengl developers will want their programs behave the way they are used to it


It was good enough for all those PS1 games, it's good enough for me :)

Yes, it's not perfect sorting - it can't handle intersecting polys, and there are cases, particularly where polys vary a lot in size, where it will fail. But for most 'clean' geometry, with back-face culling on, it works well

To fix the worst of the incorrect sorting, each mesh/model can be manually assigned a 'z bias' value - to push/pull an object forward/backwards in the sort order. (This takes a fair bit of tweaking/testing)

(Another improvement, especially if you aren't using perspective-correct texturing, is subdividing large polys as they approach the camera)

Is it worth ruling out what could be a 50%+ performance boost to save a little bit more coding?

drgoldie wrote:
z-buffer might not be the fastest method for software rendering, but it is one of the most powerfull. one of the few problems it has is transparent polygons (including antialiazed edges).
but a renderer can be speed-up e.g. by using hierarchical z-buffer.


Z-Buffers are simple and powerful. And work great in hardware. But IMHO not suitable for software-rendered real-time games on PocketPCs (and certainly not on slower machines)

Bucket sorting/'Ordering Tables' offer a very nice compromise between performance and ease-of-use.

drgoldie wrote:
btw: who said that it has to be done in software. there are quite some 3d chips for mobile devices on their way into the market...


The PocketPC market is small enough, without limiting your game to just the very very latest models.... Software rendering options will be more-or-less essential for another 2-3years or so...

Anyway, all I'm saying is that there is a significantly faster sorting method that Z-Buffering that is suitable for many/most 3D games. And limiting OpenGL:ES to depth buffers only was an odd design descision. If it's for high-end hardware 3D only/mainly, why not just use full OpenGL?....
[deleted]
Dan East wrote:
Depth buffer is implementation specific. The API supports it, but that does not mean it must be implemented, for software or hardware implementations. Hint hint.


But as they've dropped the glBegin/glEnd interface for drawing single polys, in favour of vertex arrays only, it's not ideal for 'rolling your own' sorting algorithms?

(Still not read the spec in its entirity, so could have missed something)
I don't see how that is a factor. glBegin / glEnd represents a poly. glDrawArrays / glDrawElements represents a single poly as well. So drawing still occurs at the poly level, you just don't have to feed vertices one at a time.

Dan East
glBegin / glEnd represents a poly. glDrawArrays / glDrawElements represents a single poly as well.


this is true for polys, but not for triangles. you can pass lots of triangles in a single glBegin/glEnd as well as you can do with a single glDrawArrays call.

i'm sure that for most applications an internal sorting algorithm would be fine. but what do you do in cases where a z-buffer is really needed, such as for intersecting polys? i don't know of a fast sorting algorithm that can handle this quickly.

DANIEL
Right, they both support polys, tris, strips, fans, etc.

Spans can be used for proper occlusion rendering.

Dan East
Spans can be used for proper occlusion rendering.


hmm, maybe i'll try out the "scanline-based z-min culling" tomas möller suggests in his new siggraph'03 paper.

in fact i'm currently optimizing my rasterizer and z-buffer does cost a lot of performance.

DANIEL
This is worth a read - span-based depth buffering. I had a go once, but the span insertion routine can get quite nasty (lots of cases to handle), and at low resolutions, the overhead is probably not worth the overdraw that it saves:

http://www.cstone.net/~kyoung/sbuf_faq.html
drgoldie,

Do you have a link to Moller's SIGGRAPH paper? I was unable to attend this year and I really wanted to attend his presentation. Thanks!
sorry, we only have the printed proceedings for now. we should get a cd at some time. later on the stuff will be available to ACM members as usually...

DANIEL
I have the 2003 proceedings in front of me and there is nothing my "Thomas Moller"... Any idea?

Edit:

Oops... Got it, page 801... =)
it called: "Graphics for the Masses: A Hardware Rasterization Architecture for Mobile Phones"
by Tomas Akenine-Möller & Jacob Ström
I just finishing reading the paper. Interesting stuff, but unfortunately I don't think anything in it applies to software rendering. The texture compression and multi-sampling things would kill a software rasterizer.

I am not even sure tile-based Zmin culling could be done efficiently in software. It could of course be used for scanline rendering. But then why not use a S-Buffer if the overdraw is low (<=4).

But for a hardware implementation? Cool stuff.
If you're using a traditional planar BSP then you can of course do perfect front to back sorting for free (which allow the use of coverage spans). However you still have to handle polys / particles / sprites that are not part of the BSP. That is where with Quake they threw up their hands and used a z-buffer (ie the easy way out ;) ). My testing with PocketGL, which uses an interleaved color / depth buffer, is that the addition of the depth buffer reduces performance around 33%, even when the depth buffer is not actually used (ie the penalty of extra cache loads, plus the inability to do more efficient hardware blits because of the hybrid buffer, causes the performance drop). Even if a span based system is somewhat expensive, there still may performance to be gained relative to z-buffers.

Dan East
Sorry to revive an old topic. I'm currently working on my OpenGLish 3d library, and am having trouble deciding between a z-buffer (interleaved with pixel/zbuffer data) or a depth-sort bucket based algorithm (like the playstation).

There are tradeoffs/drawback to both systems. For one, zbuffer allows more of an immediate mode drawing system to work (ie, a polygon gets sent to the rasterizer immediately after glEnd() etc), and thus drawing an object that uses the same texture for many polygons will have the texture in memory for the duration of the object drawing. Immediately obvious problems are that the zbuffer doubles the screen/zbuffer memory size, and introduces cache problems. Transparency also becomes harder.

With depth sort, the interleaved screen/zbuffer array is not required, and its cache problems are gone. However, each polygon needs to know what mode it was in at the time of drawing (lighting enabled?, shading model? texturemap? etc) to retain OpenGL-like characteristics. Also, depth-buffering will not guarantee the same texture use as it steps through its polygon list, possibly (and likely) introducing cache problems of its own. Transparency is easier...

So what do the pros here think is the better solution? It seems like PocketGL and SoftGL have gone the zbuffer route. I am currently using depth sort, but am starting to see the problems as I get closer to my texturemapping support.

My current performance is at 31fps with a 500-face flat shaded object with one light source on my Audiovox Maestro. I'd definitely like to get that higher (40-50fps) before I add Gourad and texturemapping.

Chris
If you want to improve upon your current performance, profile your code and look for the bottlenecks.

Guessing (or asking for others to guess) is one way to go about it, but it's often not the most effective.