PDA

View Full Version : convolution



Yaniv Nahum
09-25-2005, 02:04 AM
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

simongreen
09-25-2005, 04:01 AM
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