On 9/6/08, dexters <[EMAIL PROTECTED]> wrote:
>
>  Hello,
>
>  does one of you know if it is possible to change the Hue/Color of a
>  loaded image? I am asking for two reasons:
>
>  1. For my multiplayer game I need basically the same image for all
>  players with different colors. It would be nice if there would be a
>  way of changing the color of an image dynamically, so I don't have to
>  load one image per player.
>
>  2. I would like to highlight images that are 'activatable' at a
>  certaint point in time, by highlighting them (either changing color,
>  making them brighter, changing other images to grayscale, ...).
>
>  Does one of you have an idea on how to implement something like this?

You can easily "tint" the colour of an image by changing the vertex
colours.  The Sprite.color property is already set up to do this.

Tinting won't make an image brighter, but you can get this effect by
rendering the image on top of itself more than once, using a blend
function of GL_SRC_ALPHA, GL_ONE.

There's no render in greyscale.  If you're really keen, a fragment
shader can be used to do it on the fly.  Alternatively, you can render
your scene in colour in the first pass, then copy the framebuffer into
a greyscale (GL_LUMINANCE) texture and blit that texture back to the
framebuffer (possibly with some alpha so you can fade in and out of
greyscale).  Neither of these tricks are particularly simple, and
would require a little OpenGL knowledge.

Alex.

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