Jump to content

View more

Image of the Day

WIP title screen for #DeathOfAPartisan #screenshotsaturday #gamedev https://t.co/qJNhfZCvd4
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Single pass ALPHA Texutre + DIFFUSE COLOR?

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
1 reply to this topic

#1 Samurai Jack   Members   

455
Like
0Likes
Like

Posted 31 July 2013 - 08:56 AM

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!

 



#2 dpadam450   Members   

2332
Like
0Likes
Like

Posted 31 July 2013 - 12:13 PM

glColor4f(1,1,1,1) before drawing. What do you mean it is transparent? fully or partially?






Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.