Re: Partially transparent channel...

New Message Reply Date view Thread view Subject view Author view

Ran Yakir (rany++at++rtset.co.il)
Thu, 14 Nov 1996 03:25:31 +0000


> I thought this would be really easy to do in Performer, but I can't
> find a way to do it. I'd like to put a series of small channels
> at the top of the screen, overlaying the main full-screen channel.
> Since the main channel is an out-the-window view for a flight simulator,
> I don't want to entirely block the view -- instead I'd like to have
> the smaller channels semi-transparent. The game "Certain Impact"
> has a moving map display that uses this technique.
>
> I've looked at changing the pfState and the setGState for the
> channels, but it seems to me that they'd make the actual scene
> database become semi-transparent, then that would be overlayed on
> the main channel. What I'd like is the channel to be rendered normally
> but then *overlayed transparently* over the main channel.

Are the channels sharing the same database ? Ifthey are - you might be sharing
geostates among them, so that changing of geostates for the overlaying channels
changes the base channel too. Even if you're not sharing a database, some
loaders (e.g. MultiGen loader), are sharing geostates between files.

What I would suggest is changing the overall transparency of the overlaying
channels in their draw callbacks, in the following manner :

1. If you are running on RE or iR (using multisampling)

    ....

    glSampleMasgSGI (0.5, 0);
    glEnable (GL_SAMPLE_MASK_SGIS);

    pfDraw();

    glDisable (GL_SAMPLE_MASK_SGIS);

    ....

    This sets a mask on the subsamples of every pixels. Only half of them are
    writeable, so that you overlaying image is half transparent. For a
different
    value of transparency change the first argument for glSampleMaskSGIS.

2. If you are running on a lower end machine, and assuming the EXT_blend_color
extension is active :

   ....

   glBlendColorEXT (0.0, 0.0, 0.0, 0.5);
   glBlendFunc (GL_CONSTANT_ALPHA_EXT, GL_ONE_MINUS_CONSTANT_ALPHA_EXT);
   glEnable (GL_BLEND);

   pfDraw();

   glDisable (GL_BLNED);

In both cases - you might be running into trouble if you have transparent
geoetry in the database, or if you let Performer fade LODs.

Ran

-- 
 __                                  | Ran Yakir
 /_)  _  __   \  / _   / o __        | RT-SET Ltd.
/ )_ (_(_) )   \/ (_(_/<_(_)(        | 
              _/                     |   
-------------------------------------+--------------------------------
Phone :                              | E-mail : rany++at++rtset.co.il
  Work : 972-9-9552236               |          rany++at++netvision.net.il
  Res. : 972-9-7489974               |
Fax    : 972-9-9552239               |
=======================================================================
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:53:56 PDT

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