Re: Semi Transparency in Overlay Planes
Mario Veraart (rioj7++at++fel.tno.nl)
Thu, 3 Apr 1997 11:21:40 +0200 (MET DST)
>
> Julia Ellery wrote:
> > Can anyone tell me how to make an image I am drawing in the overlay
> > planes semi-transparent so that I can still see the underlying database
> > through it?
> >
> > The image in question is an array of colour index pixels in the range
> > 1 to 7. I use a call to pfuMapWinColors to setup the colour map starting
> > at index 1. My image has specially been "fixed" just to have 7 colours
> > in but this could be reduced to 5 if necessary. I am using the
> > glDrawPixels call to draw the image. I am currently doing this
> > in the perfly code, file perfly.c, routine drawOverlayName. The image
> > is currently being drawn ok but I want it transparent rather than solid.
>
> I have done this with another channel being drawn transparently over my
> main channel, rather than an image. But the technique should also
> work for any OGL call, since I'm using OGL to make it go transparent
> to begin with. Here's my code:
>
> ---
> // Set the transparency. Clear the depth so we don't use underlaying channel
> // depth settings.
> glClearDepth(1.0);
> glClear(GL_DEPTH_BUFFER_BIT);
> glSampleMaskSGIS(0.8, 0);
> glEnable (GL_SAMPLE_MASK_SGIS);
>
> // Clear and draw the channel manually.
> chan->clear();
> pfDraw();
>
> // Undo the transparency.
> glDisable(GL_SAMPLE_MASK_SGIS);
> ---
Or you can use the glBlendFunc(). I don't know if it also works with
glDrawPixels(). If not you can draw a rectangle with a texture that
matches the image you want to draw on the screen. In the OpenGL
Programming Guide page 196 you can find info about how to use it.
Mario
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2
on Mon Aug 10 1998 - 17:55:00 PDT