I'm using OpenGL and C++ and I'm not looking for optimizations just yet, just a solution to make this work. I originally had a working implementation where I just stored a buffer of unsigned bytes and just used a standard putpixel type function to render my particles, blurred it as necessary, then used glDrawPixels to render.
I'd like to have everything drawn using glBegin and glEnd calls now so I can have things like burning text. As a result, I've modified the way the code works and abstracted the blurring process and apply it to the whole screen using glReadPixels and glDrawPixels. This is my code as is. It works, but there's no blurring effect.
unsigned char* buffer = new unsigned char[640*480*3]; // this is created elsewhere obviously.
// main rendering loop.
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glReadPixels(0,0,640,480,GL_RGB,GL_UNSIGNED_BYTE,buffer);
unsigned char pixel = 0;
for (int i=1923;i<640*480*3-3;i++)
{
pixel = ((buffer[i] + buffer[i+3] + buffer[i-3] + buffer[i-1920]) >> 2) - 1;
if (pixel >= 255)
pixel = 0;
if (pixel <= 0)
pixel = 0;
buffer[i] = pixel;
}
glDrawPixels(640,480,GL_RGB,GL_UNSIGNED_BYTE,buffer);
SwapBuffers(hDC);
And of course, assume that before glReadPixels is called, I'm making calls to glBegin(GL_POINTS); setting the color and vertex data and then calling glEnd(); As I said, it renders the points just fine, but with no blur effect.











