On Mon, May 11, 2009 at 11:54 AM, Lynx <[email protected]> wrote: > > What I'm looking for here is a way to convert black-and-white images > with alpha (pixels are black, white, or 0-alpha) so that the white > pixels are 'foreground color' and black pixels are 'background > color'. I'm drawing the black-and-white images as texture-mapped > quads. > > What's the recommended way to do this? I'd prefer not to have to > rewrite the image data. >
The simplest way is to use a shader: bind your black-and-white texture to one texture unit, a 1-dimensional palette texture to another unit, and then use your shader to lookup a color inn the palette texture based on the greyscale value from the first texture. -- 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 -~----------~----~----~----~------~----~------~--~---
