On Mon, Oct 5, 2009 at 3:40 AM, Ben Sizer <[email protected]> wrote:

>
> See this picture:
> http://lostgarden.com/uploaded_images/CuteGodMockup-723198.jpg
>
> Ben, I think you may not want depth buffer at all. The reason I say that,
is that in the mockup you provided above, there is definitely antialiasing
on all the art (both tiles and characters/items). Z-buffer doesn't work
quite right with anti-aliasing (or transparency either for that matter).
Only painters algorithm gets alpha blending right for ordered items.

The problem you'll run into is that if you used depth buffer, and then drew
that antialiased 2d art out of order, then stuff that is in-front will
incorrectly obscure the stuff behind it on the antialiased edges. The basic
problem is the depth buffer is just a simple z-test that says draw or don't
draw a particular pixel. But if you are drawing behind the aliased edge of
something, theres no easy way to tell the video card to blend behind it -
you either fully draw the pixel (covering up your lovely antialiased edge,
giving both items hard edges) or skip drawing it (giving the thing you are
drawing now a weird aliased edge that looks like it's floating above the
item behind it). You can set the alpha level for when to write to the
z-buffer to try and minimize the effect, but you can't eliminate it with
z-buffer.

If you did that mockup with sprites with z-buffer with the sprites drawn out
of order, you'd get edges looking wrong and popping.

My recommendation would be to figure out how to do it painters algorithm.
There is really nothing in that mockup that hasn't been done many times just
using painters algorithm.

--~--~---------~--~----~------------~-------~--~----~
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