convolution

Hi,
I’m trying to use the GPU do to some image processing.
I’ve tryed the convolution2d (GL_ARB_imaging) and it uses alot CPU.
the code is:

glConvolutionFilter2D = (PFNGLCONVOLUTIONFILTER2DPROC) wglGetProcAddress(“glConvolutionFilter2D”);
(*glConvolutionFilter2D)(GL_CONVOLUTION_2D, GL_RGB, 3, 3, GL_LUMINANCE, GL_FLOAT, laplacian);
glEnable(GL_CONVOLUTION_2D);

and I use glDrawPixels()

any ideas how to impruve performance?
thanks,
Yaniv

What hardware are you running on? Most consumer graphics cards implement the imaging subset in software (hence the poor performance you’re seeing).

However, it’s pretty easy to perform convolutions using programmable shaders:
http://developer.nvidia.com/object/convolution_filters.html