Re: Accumlation Buffer

New Message Reply Date view Thread view Subject view Author view

Bernard Leclerc (bleclerc++at++poster.cae.ca)
Tue, 25 Mar 1997 10:47:18 -0500


Kamizi Noboru wrote:

> I'm using Performer1.2 and Performer2.0 and creating VR simulator
> system. I am trying to add motion blur effect to my simulator.
>
> I know how to get motion blur effect with Accumlation Buffer on
> GL(IRISGL and OpenGL). But, I don't know how to use Accumlation
> Buffer on Performer.
>
> Please tell me follows.
>
> (1)How to setup Accumlation Buffer ?
>
> (2)Where can I call acbuf(IRISGL) or glAccum(OpenGL) function ?
>
> (3)Is there any sample source code ?

Here are a few simple modifications to the C++ version of simple.C to
help you understand how to use the Accumulation buffer with Performer
and IrisGL.

Have fun...

// PipeConfigFunc() -- To configure the Frame Buffer
static void
PipeConfigFunc(pfPipeWindow *pw)
{
  pw->open();
  acsize(16);
  gconfig();
  acbuf(AC_CLEAR,0.0f);
}

// DrawFunc() -- Channel DRAW process callback
static void
drawFunc(pfChannel *chan, void *)
{
  chan->clear();
  chan->drawStats();

  pfDraw();

  acbuf(AC_MULT, scale);
  acbuf(AC_ACCUMULATE, 1.0f - scale);
  acbuf(AC_RETURN, 1.0f);
}

// Main() -- Main program
int
main (int argc, char *argv[])
{
  ...
  // Configure and open a GL window
  pfPipe *p = pfGetPipe(0);
  pfPipeWindow *pw = new pfPipeWindow(p);
  pw->setName("IRIS Performer");
  pw->setOriginSize(0,0,640,480);
  pw->setConfigFunc(PipeConfigFunc);
  pw->config();
     
  // Create and configure a pfChannel.
  pfChannel *chan = new pfChannel(p);
  chan->setScene(scene);
  chan->setFOV(45.0f, 0.0f);
  chan->setTravFunc(PFTRAV_DRAW,drawFunc);
  ...
}

-- 
Bernard Leclerc, Technical Leader, 3-D Graphics Applications
CAE Electronics Ltd. (http://www.cae.ca)
8585 Cote De Liesse, Saint-Laurent, Quebec, Canada, H4L-4X4
tel: +1 514 341 2000 extension 2275, fax: +1 514 340 5496
=======================================================================
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:54:57 PDT

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