Re: [AD] per-thread transformation and blending mode

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 2010-06-24, Trent Gamblin <trent@xxxxxxxxxx> wrote:
> On Thu, June 24, 2010 5:18 pm, Peter Wang said:
> >> Another idea would be to keep it per-target-bitmap. For example if you
> >> use transformations to make the coordinate system go from 0,0 to 1,1 for
> >> the whole backbuffer it would be annoying if you have to reset it each
> >> time you switch back from drawing to another bitmap.
> >
> > Good idea.  Each bitmap has its own clipping rectangle, and I think
> > transformations go along with that.
> >
> > I *think* I would prefer the blending mode to be per-thread, though.
> 
> In practice I find that transformations and blending are things that change
> often, even if the target bitmap doesn't change. If you're drawing a 3d (or
> say a 2d skeletal animation), you're going to be switching transforms a lot,
> and the case is the same for blending when you're drawing complicated scenes.
> Therefore, I think they should go in the most logical place. I'm not sure
> which of TLS and bitmap is the most logical, but I'd prefer TLS unless I'm
> missing something. But actually the example quoted is something that would
> happen often too... so I could be wrong.

I think one of the main uses of transformations would be to set up a
logical coordinate system for the display.  From that perspective, it
would make sense for transformations to be per-bitmap.

It would make sub-bitmaps even more useful, too.  You could set up a
game-oriented coordinate system for the whole screen, and on top of that
you create an overlay as a sub-bitmap and use the usual pixel-based
coordinate system.

Peter




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/