Re: Re[2]: How do I overlay Performer scene on X window grafic c

New Message Reply Date view Thread view Subject view Author view

Mario Veraart (rioj7++at++fel.tno.nl)
Wed, 17 Jun 1998 15:42:22 +0200 (MET DST)


Mitsugu isomura wrote:

> > Would it make any sense to draw the performer scene first and then render
> > the image with alpha on top of the scene?
>
> First image is X window pixmap image. This is not created by performer.
> Image is transferred form video signal(16mm film image ,VTR image etc.).
> Second image is created by Performer. And Second one must be rendered with alpha
> on top of the scene.
>
> _______________________________
> / /
> Second image / Performer Scene /
> / (half transparent) /
> / /
> /______________________________/
>
> +(alpha blending)
> _______________________________
> / /
> First image / picture image /
> / (Ximage format) /
> / (no transparent) /
> /______________________________/
>

You can accomplish this with the help of the stencil buffer.
You are not allowed any HIGH_QUALITY layers in the Performer scene.

    Clear the stencil buffer together with the z-buffer
         (no need for the frame buffer because it will be filled
         completely by the video image)
    Set the stencil operation to set a stencil bit if it passes the
       Z-test (stencil test is ALWAYS-pass)
    Draw performer scene (pfDraw)
    Define an orthographic view frustum (glOrtho() )
    Set stencil operation to KEEP all bits.
    Set stencil test to pass where stencil == 1
    Enable blending and set the required ratio and blend function
    Draw the Ximage as a textured quad
        (glBegin() glVertex2f() glEnd() )
    Set stencil test to pass where stencil == 0
    Disable blending
    Draw the Ximage as a textured quad
    Restore the state and frustum that you have set

The drawing of the X-image can best be done with a subloading of a
texture.
All operation can be implemented with the OpenGL or IrisGL calls
And some can be done with Performer GL independent functions

Mario
=======================================================================
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:57:33 PDT

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