That whole Buffer thing again...

BlitzMax Forums/OpenGL Module/That whole Buffer thing again...

Hotcakes(Posted 2005) [#1]
I have a different interest in buffers than most others seem to have, instead of layering on static objects onto a background image, I need to ERASE portions of the background image - this is vital in that the background image is used for collision detection.

Would I be right in thinking that PBuffers would help me here?

Alternatively, how feasible do you think it would be to effectively do all my drawing in software - storing everything in Pixmaps, drawing everything to a (say 1024,1024) Pixmap and then upping that one pixmap to the card and drawing it to the backbuffer every frame? According to my calculations that should be fine for AGP bus bandwidth..?


ImaginaryHuman(Posted 2005) [#2]
Uploading a whole pixmaps especially of that size would be pretty slow. On my system it would probably single-handedly drop the framerate to 16 fps or so, and that's just the upload. glDrawPixels() uses the CPU to move the data OVER the bus between the main computer hardware and the graphics card, so it's not usually very fast. I had to entirely ditch the idea of using main-memory graphics rendering in order to get my blobs routine working fast enough, otherwise it was way down like 4-8 fps.

You could perhaps use an Image to store your background, redraw it each frame, then draw any erased changes to the background, then use the appropriate OpenGL call to transfer the background into the existing texture to store the changes.

Otherwise if you want to keep lots of erase changes offline you have to figure out a way to spool the changed areas to the gfx card or something.

The way I've got around it is that I allow things to be erased, but my background is created out of lots of textured polygons so it's a matter of uploading the polygon data to the card rather than the texture data.