[info-performer] Porting convolution filtering from IRISGL to OPENGL.

Date view Thread view Subject view Author view

From: Noureddine Rabiai (rabiai++at++cae.com)
Date: 11/11/2004 11:04:12


Hello,

I am trying to port an application written in IRISGL to OPENGL.
I was able to find the equivalent functions for the code writen in IRISGL
while using toogl.exe.
 
But I perceive that the equivalent functions in OPENGL don't work on LINUX??

I have Performer 3.0.2 installed on my PC and my graphic card is FIREGL4.
In fact, while using glGetString(GL_CONVOLUTION_2D_EXT) the function
returned a NULL string, It means that my video card would not support this
extension??
  
Here is the code:

#ifdef IRISGL
    // Enable convolution on graphics card.
    convolve( filter.mode == VR_CONV_GENERAL ? CV_GENERAL : CV_SEPARABLE,
              CV_REDUCE,
              filter.size, filter.size, filter.kernel,
              filter.bias );

    // Apply convolution kernel.
    rectcopy( xo, yo, xo+xs-1, yo+ys-1, xo+to, yo+to );

    // Disable convolution kernel on graphics card.
    convolve( CV_OFF, CV_REDUCE, 0, 0, filter.kernel, 0.0f );
#else //LINUX

     p = (char *)glGetString(GL_CONVOLUTION_2D_EXT);
     if( NULL == p){
         pfNotify(PFNFY_WARN, moduleId, "CONVOLUTION_2D_EXT NOT SUPPORTED??
."); }

    // Enable convolution on graphics card.
    if ( filter.mode == VR_CONV_GENERAL ) {
      
      glEnable(GL_CONVOLUTION_2D_EXT);
      glConvolutionFilter2DEXT( GL_CONVOLUTION_2D_EXT,
                                GL_RGBA,
                                filter.size,
                                filter.size,
                                GL_RGBA,
                                GL_FLOAT,
                                filter.kernel );
    }
    else {
      glEnable(GL_CONVOLUTION_2D_EXT);
      glSeparableFilter2DEXT( GL_SEPARABLE_2D_EXT,
                              GL_RGBA,
                              filter.size,
                              filter.size,
                              GL_RGBA,
                              GL_FLOAT,
                              filter.kernel,
                              filter.kernel );
    }
    
    // Apply convolution kernel.
    glRasterPos2i( xo+to, yo+to );glCopyPixels( xo, yo, xo+xs-1- xo+1,
yo+ys-1- yo+1, GL_COLOR);

#endif

Thanks.
 


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Thu Nov 11 2004 - 11:05:00 PST