Re: Semi Transparency in Overlay Planes

New Message Reply Date view Thread view Subject view Author view

Jan Barglowski (jan++at++euryale.chinalake.navy.mil)
Wed, 2 Apr 1997 13:16:26 -0800 (PST)


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);

---

NOTE: I'm using an iR, so this trick with the sampling may only work on an iR! I may be able to find another technique given to me by the Performer list a few months ago for non-iR (or was it GL-based) machines, if needed.

Just knock out the channel drawing code and insert your glDrawPixels code...

-- 
Jan Anthony Barglowski	              jan++at++chinalake.navy.mil
Real-time Computer Graphics           http://www1.ridgecrest.ca.us/~jan
Naval Air Warfare Center, China Lake  (619) 927-1057
=======================================================================
List Archives, FAQ, FTP:  http://www.sgi.com/Technology/Performer/
            Submissions:  info-performer++at++sgi.com
        Admin. requests:  info-performer-request++at++sgi.com

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:55:00 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.