The Accumulation Buffer is too slow...?

Hi,

I am writing an OpenGL screensaver and I’m trying to add a “trails”/“motion blur” effect to it. The easiest way for more to do this was to simply not clear the color buffer.

My problem is that on some hardware accelerated machines if I do this in Double Buffered mode every other frame will have half of the previous renderings and then switch to the half that was missing. I can switch to single buffering mode and this will eliminate that problem, but now I can see each frame being drawn (at least on most machines). I have been trying to come up with an implemenation that will work with the desired effect on all machines.

I can use the Accum buffer to get the effect and actually make it look much better… however this kills the frame rate, even when run on a Voodoo 5.

Any ideas on how to get the effect without killing my framerate?

Thanks,
Gregg

I have just tried creating a display list for each time, then calling the list, switching buffers and calling the list a second time. This will take care of all of the problem however I still take a signifcant framerate hit. The accum buffer still gives me the best flexibility but is soooo slow. I would love to here comments or suggestions on what would be the best way to cleanly acheive the effect of leaving all the shapes on the screen.

Thanks,
Gregg

You probably have selected a pixelformat with the PFD_SWAP_EXCHANGE flag set.
If you want to be sure that all contents of the backbuffer remain unchanged during SwapBuffers() you have to select a pixelformat with the PFD_SWAP_COPY flag.
Beware of ChoosePixelFormat(), it ignores this flag!!!

To get an awesome T-buffer like effect you should try to replace your glClear(GL_COLOR_BUFFER_BIT) call with a black transparent rectangle (with disabled depth test).
The transparency of the rect controls how long it takes for one image to be fully erased. Let’s say alpha = 0.l25 erases the contents after eight frames. This gives a nice blurring effect.

This could look weird sometimes with z-buffered objects but allows great particle demos.

[This message has been edited by Relic (edited 08-15-2000).]

Hi,

Thanks for the tip… I set up my program so that it would hand select a pixel format with PFD_SWAP_COPY enabled, and it gave me the effect that I’m looking for. However, mplementing it this way also gives me a rather large framerate hit. I’m wondering if I’m trying to get something for nothing and if there’s no fast clean way of doing this.

Thanks,
Gregg

If it’s very slow, you’ve probably hit a MS GDI generic implementation. Check the glGetString(GL_VENDOR) contents.

Depending on the quality of the ICD (means spedd of glCopyPixels) implementation you could get the same effect with any double buffered pixelformat and the use of glCopyPixels() instead of SwapBuffers().

This is unusual in games, so you could also end up in a software implementation of that particular function on a Voodoo board, but I have no experience with these.

A blit is definitely slower than page flipping, but with the current generation of consumer level boards the animation should still be fluid if it was with page flipping before. Though the transparent fullscreen rect would be definitely slower than a clear.