Talk About Network

Google





Graphics > OpenGL 3D API > Re: BLending an...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 6 Topic 4815 of 5061
Post > Topic >>

Re: BLending and Transparency

by karim.atiki@[EMAIL PROTECTED] Jun 29, 2008 at 12:20 AM

On 29 juin, 01:20, Andy V <nob...@[EMAIL PROTECTED]
> wrote:
> karim.at...@[EMAIL PROTECTED]
 wrote:
> > Hi all,
>
> > I'm experiencing a strange issue.
> > I display an image which is a textured quad in RGB format.
>
> > I try to display a transparent rectangle over it.
> > I use the following code:
>
> > glPushMatrix();
> > =A0 glEnable(GL_BLEND);
> > =A0 =A0glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
> > =A0 =A0 glColor4d(0.0, 0.0, 1.0, 0.5);
> > =A0 =A0 glRecti(rc.left(), rc.top(), rc.right(), rc.bottom());
> > =A0 glDisable(GL_BLEND);
> > glPopMatrix();
>
> > It works fine.
> > But with some images, the rectangle is not transparent blue, but BLACK
> > transparent...
> > And I just can't figure out what's the trick.
> > It is a simple PNG image (RGB) and it is just well displayed on scrren
> > though.
>
> > Any idea or suggestion ?
>
> As a wild guess, do you need to disable texture mapping?
>
Hello Andy,

good question.
I don't know if I have to disable it.
But I just slightly modifiy my code in order to disable texture_2d and
re-enable it after the rect is drawn.
And it works fine now !

But I'm not so happy as I do not understand why I have to disable
texture 2D....
 




 6 Posts in Topic:
BLending and Transparency
karim.atiki@[EMAIL PROTEC  2008-06-28 11:14:27 
Re: BLending and Transparency
karim.atiki@[EMAIL PROTEC  2008-06-28 11:52:11 
Re: BLending and Transparency
Andy V <nobody@[EMAIL   2008-06-28 19:20:48 
Re: BLending and Transparency
karim.atiki@[EMAIL PROTEC  2008-06-29 00:20:24 
Re: BLending and Transparency
Wolfgang Draxinger <wd  2008-06-29 12:28:29 
Re: BLending and Transparency
karim.atiki@[EMAIL PROTEC  2008-06-29 03:57:20 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Fri Jan 9 15:42:51 PST 2009.