On Tue, Aug 18, 2009 at 7:55 AM, Alex Holkner <[email protected]>wrote:

>
> On Tue, Aug 18, 2009 at 9:22 PM, Florian Bösch<[email protected]> wrote:
> >
> > On Aug 18, 12:52 pm, Tristam MacDonald <[email protected]> wrote:
> >> I wrote a small immediate-mode GUI toolkit for pyglet a while ago (not
> >> publicly available at the moment, sorry), and the lack of batching was
> the
> >> difference between 80 fps and simplui's 500+ fps.
> >
> > Though I have a question about batched GUI rendering. It's my
> > understanding that for instance nvidia drivers reorder the primitives
> > in a vertex-list pretty much at random. If you draw two elements on
> > top of each other (like the frame background and the button
> > decoration), using batches, isn't it bound that happen that under some
> > random circumstances your graphics driver will completely foobar your
> > gui display?
>
> I too have heard that maintaining vertex ordering is not a requirement
> of OpenGL, but I haven't seen the relevant part of the specification
> to be sure, nor have I seen it happen in practice.  Incrementing Z for
> each primitive in your draw order should be sufficient to maintain
> that ordering though, even if the driver does like to reorder things
> at the same Z depth.


OpenGL doesn't have any concept of 'same Z depth' during vertex processing,
because a) there is no reason for the Z-axis to be perpendicular to the
screen, and b) post-projection depth is only available after the vertices
have been transformed.

In addition, you can't reorder vertices in isolation, because it would screw
up the primitives. Instead you have to reorder entire primitives (quads,
triangles, etc.), and that would be almost impossible to do by depth,
because primitives can be mutually overlapping.


-- 
Tristam MacDonald
http://swiftcoder.wordpress.com/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to