Sign in to follow this  
by321

drawing color tinted grayscale bitmaps

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this