Re: motion blur in performer

New Message Reply Date view Thread view Subject view Author view

Bernard Leclerc (bleclerc++at++cae.ca)
Wed, 27 Sep 1995 11:53:25 -0400


On Sep 26, 12:40pm, Anita Kishore wrote:

> I have a problem in motion blur when I try doing it against a static
> background. I loose the "vapour trails" of the moving object with each
> accumulation because I think the remenants of the previous image of the
> moving object is being wiped off by the current accumulation of the scene.
> If I have no static part, then I get a nice moving geometry leaving behind
> it a nice vapour trail. My set up is as follows:
>
> scene graph looks like:
>
> pfScene
> |
> --------------
> | |
> pfDCS static scene
> | background
> object to be
> motion blurred
>
>
> In the pipe window configuration callback:
>
> pfOpenPWin(pw);
> drawmode(NORMALDRAW);
> subpixel(TRUE);
> acsize (16);
> pfInitGfx();
> acbuf (AC_CLEAR, 0.0);
>
> In the motion blurred geometry node's post traversal DRAW callback:
>
> acbuf(AC_MULT, .88); // .88 controls the size of vapour trail
> acbuf (AC_ACCUMULATE, 1.0);
> acbuf (AC_RETURN, 1.0);

I have the impression that you should not use a node's post traversal DRAW
callback since the scene hasn't been completely drawn yet. You should wait
until everything is drawn, i.e. the moving object and the static background. I
suggest to use a channel DRAW callback to accumulate the image.

        static void drawFunc(pfChannel* chan, void* data)
        {
          static float f = 0.0;
          chan->clearChan();
          pfDraw();
          acbuf(AC_MULT, .88);
          acbuf (AC_ACCUMULATE, 1.0);
          f = 0.88*f + 1.0;
          acbuf (AC_RETURN, 1.0/f);
        }

> The object is translated to certain distance through the DCS.
>
> With this setting the inside of the object is blurred, but it doesn't
> have a trail. The call to acbuf (AC_ACCUMULATE, 1.0) destroys the previous
> contents of the acbuf and hence the trail is lost.

Here, I suspect the moving object is drawn before the static background. With
the node's post DRAW callback, you end up blurring the moving object on a black
background. Later, when the static background is drawn, it erases the trail of
the object.

Hope it helps you...

--
      ___/      |        ___/	Bernard Leclerc		e-mail: bleclerc++at++cae.ca
     /        / |       /	Systems Engineer	voice: +1 514 341 2000
    /        /  |      __/	CAE Electronics Ltd.		extension 2275
   /        /   |     /		8585 Cote De Liesse	fax:   +1 514 340 5496
  /        ____ |    /		P.O. Box 1800
_____/   _/    _|  _____/	Saint-Laurent, Quebec, Canada, H4L-4X4

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:51:54 PDT

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