[gl2ps] Transparency problems

Christophe Geuzaine geuzaine at acm.caltech.edu
Thu Dec 16 04:47:30 CET 2004


David Thompson wrote:
> I've been using the gl2ps library for quite a while and have decided to 
> try using some transparency. Whoa!, this isn't working the way I'd expect.
> 
> For one thing, BeginPage is checking to see if GL_BLEND is on. However, 
> I turn GL_BLEND on for some primitives and not for others--so that check 
> always returns false and makes it so blending doesn't work. 

That's how it's supposed to work at the moment. If you want to enable 
blending locally, you have to use gl2psEnable(GL2PS_BLEND) and 
gl2psDisable(GL2PS_BLEND) pairs around the OpenGL calls that need blending.

I would prefer to treat blending like we deal with lighting (i.e., just 
do the "right thing" if we detect that we have an alpha component in 
feedback buffer vertices) but that still needs to be implemented and tested.

Christophe



> I hardcoded 
> it to 1 to get around this problem. Next problem arises with strange 
> outputs of the images. I get boundary lines on a lot of the transparent 
> triangles. It makes the output impossible to use. The Test program shows 
> this problem also (especially OutBSP.pdf). I would like to try and help 
> trouble-shoot this, but I'm just tracing the code and can't quite get my 
> mind around how it is supposed to be working. Anybody have an overview 
> of how the blending is different than the regular output?
> 
> Then I see that there is a function gl2psEnable(GL2PS_BLEND), but there 
> is no example using this and the documentation really doesn't say what 
> it does. Would this be the way that I should use blending since my 
> primitives are turning blending on and off?
> 
> David


-- 
Christophe Geuzaine
Applied and Computational Mathematics, Caltech
geuzaine at acm.caltech.edu - http://geuz.org