Only blur algorithm i know that works well, reads 1+4 pixels RGB(A) values around it (up, down, left, right and self), and averages them. To get perfect result, you can't be writing to same data array that you are reading from, i mean after you have blurred top row, you would be using blurred values and nonblurred values mixed. So you need to allocate the texture memory again for writing, free the old data after blur, and then set the real texture use the newly allocated pointer.
To get even better blur, you can read the corners aswell, and average that 9 pixel data. That's obviously slower, but possibly not as slow as doing a second pass.
Bookmarks