Re: 1D Convolutions in real-time...

New Message Reply Date view Thread view Subject view Author view

Rob Jenkins (robj++at++quid)
Tue, 4 Nov 1997 21:49:45 -0800


On Nov 4, 3:10pm, Jan Barglowski wrote:
> Subject: 1D Convolutions in real-time...
> Help!
>
> Another project has a Onyx Reality Engine 2, 8 R4400 CPUs.
> They need to know if they can use the glConvolutionExtensions()
> in a postdraw callback to do a simple convolution at 30Hz and 512x512.
>
> Of course, the demo is tomorrow and nobody around here has
> done convolutions before (so I got asked ;-) If anyone has
> done this before, knows any potential problems with the
> convolution filters, and can possibly spare any code snippets
> my coworkers would be eternally grateful!
>

The man page for glConvolutionFilter1DEXT says it's not supported on RE2.
glConvolutionFilter2DEXT is though and the man page lists some conditions to
look out for when using it ( in the 'MACHINE DEPENDENCIES' section ).

The very simplest code would be something like:

    static float kernel[] = {
            -1, -1, -1,
            -1, 9, -1,
            -1, -1, -1
    };
    glConvolutionFilter2DEXT(GL_CONVOLUTION_2D_EXT, GL_LUMINANCE,
                                         3, 3, GL_RED, GL_FLOAT, kernel);
    glEnable(GL_CONVOLUTION_2D_EXT);

    glCopyPixels(0, 0, 256, 256, GL_COLOR);

But to account for the things listed in the man page ( like disabling certian
modes ) then you'd want to be sure to save the performer state, set you modes
for the convolution, then reset the performer state. You can do much more
involved convolution things with glPixelTransfer too.

Also I'd recommend checking that you have the latest gfx patch for your
platform, that's 2038 for RE2 ( or 1808 for Onyx iR and 2191 for Onyx2 iR )

Cheers
Rob

-- 
________________________________________________________________
Rob Jenkins mailto:robj++at++sgi.com
Silicon Graphics, Mtn View, California, USA
=======================================================================
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:56:12 PDT

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