Jump to content
  • Advertisement
Sign in to follow this  
FlyingSolo

Apply texture with separate alpha mask

This topic is 3066 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
Advertisement
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

I need to keep this as compatible as I can with old opengl so sadly, shaders are out.

The effect this 'mask' gives is one of light and dark areas (shadows) - if that helps !?

Share this post


Link to post
Share on other sites
They say a picture is worth a thousand words...

Looky here: www.aerobits.org/shade

the 'mask' image gives the center of the instrument some shading which gives the illusion that it's a sphere - like the real thing.

I've piddled about with blendfunc all evening and can't crack it.

Anyone?

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!