Sign in to follow this  

Apply texture with separate alpha mask

This topic is 2852 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

I've got a texture which looks ok but I also have a second texture which is meant to overlay the first to give it some 'depth'. The 1st texture is a full colour 'picture', the 2nd is just shades of grey. I've been back and forth through the Red book to no avail. Anyone got a clue I could use!? Thanks. [Edited by - FlyingSolo on February 22, 2010 7:46:56 PM]

Share this post


Link to post
Share on other sites
Have you considered writing a shader to handle this? I'm not sure what functionality exists in plain openGL to achieve that effect, but with a shader I think that should be trivial (and a good learning exercise).

Also are you talking about an alpha map or a depth map? I think alpha channel is typically considered to be a transparency channel, but you sound like you are talking about a depth map or bump map.

If you just start flipping through a few GLSL articles you should be able to work it out I think.

Share this post


Link to post
Share on other sites
How about multitexturing? I have never used it myself but it seems appropriate for your use:
http://jerome.jouvie.free.fr/OpenGl/Tutorials/Tutorial22.php

Share this post


Link to post
Share on other sites
In graphics, a equation is worth more than a picture :)

A quick tought is use multitexturing (no blending required) and multiply (GL_MODULATE) both texture colors.

Share this post


Link to post
Share on other sites
My guess is you need to multiply the texels together so my guess is GL_MODULATE for GL_TEXTURE0 and GL_TEXTURE1.
glActivateTexture(GL_TEXTURE0);
glTexEnv(........GL_MODULATE);
glActivateTexture(GL_TEXTURE1);
glTexEnv(........GL_MODULATE);

Share this post


Link to post
Share on other sites

This topic is 2852 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.

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