From reedwhit@skips.dseg.ti.com  Fri Oct  8 14:28:03 1993
Date: Fri, 8 Oct 93 16:26:58 CDT
From: reedwhit@skips.dseg.ti.com (Reed Whittington)
Message-Id: <9310082126.AA22246@skips.dseg.ti.com>
To: info-performer@sgi.sgi.com
Subject: Best HUD in Perfomer
Status: OR




I'm looking for the most efficient way to implement HUD symbology on
top of a performer visual.  I have tried drawing to the overlay plane 
in a post draw call back.   This tends to task the graphics pipe more 
than would be expected.  Even drawing every 10th frame creates a big 
spike. I have considered putting the symbology in its own pfChannel.  

Would this be recommended?  What have others tried?

It seems the Performer Channel Stats are efficiently implemented.
How were the ChanStats done?

--Reed 



From srf@rose  Fri Oct  8 15:23:03 1993
From: srf@rose (Sharon Fischler)
Message-Id: <9310081522.ZM19134@rose.asd.sgi.com>
Date: Fri, 8 Oct 1993 15:22:50 -0700
References: <9310082126.AA22246@skips.dseg.ti.com>
To: reedwhit@skips.dseg.ti.com (Reed Whittington), info-performer@sgi.sgi.com
Subject: Re: Best HUD in Perfomer
Status: OR

+>---- On Oct 8,  4:26pm, Reed Whittington wrote:
> Subject: Best HUD in Perfomer
->
->
->
->I'm looking for the most efficient way to implement HUD symbology on
->top of a performer visual.  I have tried drawing to the overlay plane
->in a post draw call back.   This tends to task the graphics pipe more
->than would be expected.  Even drawing every 10th frame creates a big
->spike. I have considered putting the symbology in its own pfChannel.

Draw your static info in the overlay planes and ONLY redraw it
when the window receives a REDRAW event (moved, resized, etc.).
Changing between drawing to the overlays and drawing to regular
bitplanes takes a big hit.

For things that need to be updated real-time,
you can set
	zfunction(ZF_ALWAYS);
	zwritemask(0x0);
draw stuff
	zfunction(ZF_LEQUAL);
	zwritemask(0xffffffff);

If you have a whole lot of stuff to draw, then it might
	faster to just turn off zbuffer but I would think
	that most HUDs aren't that dense.

you also want to disable fog BEFORE you change the
projection matrix (ortho2).

srf.

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sharon Rose Fischler - Silicon Graphics, Advanced Graphics Development
srf@sgi.com   (415) 390 - 1002   MS 7L-590
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~






From wgerhard@afit.af.mil  Sat Oct  9 11:08:11 1993
Date: Sat, 9 Oct 1993 14:08:00 -0400
From: William E Gerhard <wgerhard@afit.af.mil>
Message-Id: <199310091808.AA00347@stealth.afit.af.mil>
To: info-performer@sgi.sgi.com
Subject: HUD's in performer
Status: OR


I have been working on a distributed interactive flight simulator here
at AFIT and I used GL calls in a draw call back.  The call back is setup
to be called after our aircraft model is drawn.  All the vertices in the
bgnline();...endline(); calls are defined in our aircraft model space.  We
use a Polhemeus Fastrack with this thing, so as an added bonus, the HUD
changes perspective with the rest of the simulation if the pilot moves
his head.

The text on the HUD was a little more difficult, but I ended making a
vector based font class which works well.  There is not much of a 
performance hit with this scheme if as many of the vertices as possible
are defined as static.

Bill Gerhard

wgerhard@afit.af.mil



From guest  Wed Mar  9 08:28:49 1994
From: Mark Coyle <coyle@dexter.psych.umn.edu>
Subject: GL and Performer
To: info-performer@sgi.sgi.com
Message-Id: <9403091423.AA25661@dexter.psych.umn.edu>
X-Mailer: ELM [version 2.4 PL6]
Content-Type: text
Content-Transfer-Encoding: 7BIT
Content-Length: 435
Status: OR

Hi,

I know this is in the FAQ but I can't seem to get GL to draw
into a Performer Window (i.e. a HUD).  I'm sure it is just
a wrong/missing/ function call.  If anyone has a simple sample
program that does this, i would  appreciate getting a copy
of the code.  I have just signed onto this group, so I apologize if this
questioned has been answered before.




Mark Coyle


Human Factors Lab
Computer Science Department
U of Minnesota




From guest  Wed Mar  9 09:50:24 1994
Date: Wed, 9 Mar 94 11:27:55 CST
From: aaron@skips.dseg.ti.com (Aaron M. Hightower)
Message-Id: <9403091727.AA17205@skips.dseg.ti.com>
To: iris-performer@sgi.sgi.com
Subject: Drawing HUD's
Status: OR


From the FAQ: (Sharon Fischler)
------------
Subject:   -12- How do I overlay graphics on top of my Performer scene?
Date: 06 Oct 93 00:00:01 EST

Typically this is done to implement a heads-up display (HUD).

In the draw function callback, the basic algorithm is:

    save state with pfPushState()
    disable textures, fog, & lighting with pfBasicState()
    save & clear projection matrix
    ortho2()
    save & clear modelling matrix
    draw()
    restore modelling matrix
    restore projection matrix
    restore state with pfPopState()

Or, you can draw your static info in the overlay planes and only redraw
it when the window receives a REDRAW event (moved, resized, etc.).
Changing between drawing to the overlays and drawing to regular
bitplanes takes a big hit.

For things that need to be updated real-time, draw() would consist of:

    zfunction(ZF_ALWAYS);
    zwritemask(0x0);
    draw HUD stuff
    zfunction(ZF_LEQUAL);
    zwritemask(0xffffffff);

-----------------------------------------------------------------------------
Example: (modification of PostDraw from Perfly)

void drawHUD(pfChannel *chan) /* example function */
{
  pfPushState();
  pfBasicState();
  pfPushIdentMatrix();
  zfunction(ZF_ALWAYS);
  zwritemask(0);

/* Example of how to put into pixel coordinates.
 * Not necessary depending on requirements of GL calls
 * IE: You may want to use different coordintes instead
 */
  pfGetChanSize(chan,&chanSizeX,&chanSizeY);
  ortho2(-.5f,chanSizeX-.5f,-.5f,chanSizeY-.5f);

  **** DRAW GL JUNK HERE ****

  zfunction(ZF_LEQUAL);
  zwritemask(0xffffffff);

  pfPopMatrix();
  pfPopState();
}

void
PostDraw(pfChannel *chan, void *data)
{
  drawHUD(chan); /*** Insert this line into PostDraw in perfly ***/
  if (ViewState->stats) pfDrawChanStats(chan);
  if(chan == ViewState->masterChan) pfuCollectInput();
}



From guest  Tue Jun 14 09:09:37 1994
Date: Tue, 14 Jun 94 09:09:30 -0700
From: stimpy@niesten.arc.nasa.gov (William Briggs)
Message-Id: <9406141609.AA05949@niesten.arc.nasa.gov>
To: info-performer@sgi.sgi.com
Subject: 2-D Overlay
Status: OR

I am using IRIX 4.0.5 and Performer 1.0 on a SkyWriter (no RE...yet :^)

Is it possible to do a two-dimensional overlay in a channel?  Up until
now, I have drawn a crosshair with a draw callback.  I transform to the
viewpoint and then in front of it.  However, roundoff error causes the 
crosshair lines to wiggle, forcing me to put them farther away.  With 
them farther away, they interact with the terrain, dissapearing behind
it when the viewpoint is too close.  




From aschaffe  Tue Jun 14 13:30:37 1994
From: aschaffe (Allan Schaffer)
Message-Id: <9406141330.ZM12638@holodeck.asd.sgi.com>
Date: Tue, 14 Jun 1994 13:30:22 -0700
In-Reply-To: stimpy@niesten.arc.nasa.gov (William Briggs)
        "2-D Overlay" (Jun 14,  9:09am)
References: <9406141609.AA05949@niesten.arc.nasa.gov>
X-Mailer: Z-Mail (3.1.0 22feb94 MediaMail)
To: stimpy@niesten.arc.nasa.gov (William Briggs)
Subject: Re: 2-D Overlay
Cc: info-performer@sgi.sgi.com
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0
Status: O

On Jun 14,  9:09am, William Briggs wrote:
> I am using IRIX 4.0.5 and Performer 1.0 on a SkyWriter (no RE...yet :^)
>
> Is it possible to do a two-dimensional overlay in a channel?  Up until
> now, I have drawn a crosshair with a draw callback.  I transform to the
> viewpoint and then in front of it.  However, roundoff error causes the
> crosshair lines to wiggle, forcing me to put them farther away.  With
> them farther away, they interact with the terrain, dissapearing behind
> it when the viewpoint is too close.

You might try changing the Z buffer state right before and after you
draw the crosshairs.  This will force them to always be drawn "over"
the scene.

	pfDraw();
	...
	zfunction(ZF_ALWAYS);
	zwritemask(0x0);
	draw crosshairs
	zfunction(ZF_LEQUAL);
	zwritemask(0xffffffff);

Allan


-- 
Allan Schaffer
Silicon Graphics
aschaffe@sgi.com





