On 04/12/2008, at 6:39 AM, josch <[EMAIL PROTECTED]> wrote:

>
> @alex
> can you point me to some examples of this tricks or keywords i can
> google? from the opengl docs i read that the alpha blending is only
> correctly applied when the background is drawn before the alpha
> channel foreground is.
> well the terrain itself is only solid 32x32 pixels but i dont know of
> any map object that doesnt have a transparent or half transparent
> (shadow) area.

See glBlendFunc.

Alex.

>
>
> @tristam
> terrain layer actually is only one group as it is flat.
> well i dont understand how one could draw things with only 2-3 groups.
> imagine a texturegion from texture A being one map object and a
> texture region from texture B being another object. in some cases A is
> dawn in front of B and in other cases the other way round. this is why
> i have a parent ordered group for all the texture groups.
> this is also the reason why i just cant order all texture regions from
> texture A, draw them, order those from texture B and draw them too.
> this way incorrect ordering in some cases would be the result. maybe A
> is correctly drawn in front of B in the first case but in the second
> it was supposed to be the other way round and this is why i order
> them.
>
> actually the ordering is done in a very simple way: the higher the y
> coordinate of a map object the higher the order, so that objects are
> drawn from top row to the bottom and hence correctly overlap.
>
> i also though of a more optimized way to assign ordering. i could do
> some heavy math on resource loading and analyze all neighbors of an
> object. if there is one in front of it AND their boundaries actually
> overlap, then give this object a higher ordering than the tested one.
> this would result in a kind of tree structure and probably in overall
> less groups. i dont do this because of two reasons: first this would
> be really resource intensive and second and most important - map
> objects change places so that these orderings would change even after
> the resource loading and this combined with the testing of neighbor
> objects boundaries math involved would probably be overkill too.
> >

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to pyglet-users@googlegroups.com
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