Sign in to follow this  

drawing color tinted grayscale bitmaps

This topic is 2283 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,

I want to draw a grayscale bitmap multiplied with a color value. Let's say the color value is (r,g,b), and the value of a pixel in the grayscale bitmap is p, then (r*p/255,g*p/255,b*p/255) should be drawn for that pixel.

Another way of looking at it doing a polygon color fill, and using the grayscale bitmap as the alpha channel.

For each grayscale bitmap, I'd need to draw it in multiple "tints", each with a different color value.

An easy way to do this is creating multiple temporary textures, but it seems pretty inefficient and wasteful.

What's the best way to do this ? Is there a shader-less, single-pass solution ?

Share this post


Link to post
Share on other sites
Set the TexEnv state to GL_MODULATE and set the color with glColor.

Share this post


Link to post
Share on other sites
[quote name='V-man' timestamp='1318837209' post='4873366']
Set the TexEnv state to GL_MODULATE and set the color with glColor.
[/quote]


Will try, thanks for the tip.

Share this post


Link to post
Share on other sites
Sign in to follow this