Sign in to follow this  
Samurai Jack

Single pass ALPHA Texutre + DIFFUSE COLOR?

Recommended Posts

Samurai Jack    455

Hello!

 

My problem is as follows:

 

1. I have a 32 BIT RGBA texture with colors and ALPHA. The texture contains a logo.

2. I would like to draw the logo transparent on a QUAD which is solid and SIGNLE color. I use:
 

glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);

3. The logo gets drawn, but it is TRANSPARENT. It ignores any BACKGROUND color I would like to use.

 

So to simplify, I can avoid the problem by:

1. Draw a QUAD of signle color without texturing

2. Draw the QUAD again with ALPHA texture

 

Why do I have to draw 2 times? Is there a way, I would provide color either glColor or glMaterial and use it in single pass?

I do not use any shaders. Fixed function pipeline ONLY. I have read something about glTexEnv but I do not understand it.

 

Feel free to post.

Thank you in advance!

 

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