Dynamic multiple image buffers?

BlitzMax Forums/BlitzMax Beginners Area/Dynamic multiple image buffers?

Ryan Burnside(Posted 2007) [#1]
Is it possible to create a image or image buffer dynamically with a reasonably large resolution? I would like to have a sort of second image buffer that could be drawn over the usual image. The problem of course is that there is no way to write the image using the per pixel writing commands. I would need to create and update a 640 by 480 image. This image would be used as a sort of overlay to the normal buffer. This extra image buffer is a way to store graphics data for later processing and drawing. Things like blurring and fading plasma effects can be done independently of the default back buffer.


I know the game development program 'Game Maker" called them surfaces but I have no idea how the initial creator implemented them.


Dreamora(Posted 2007) [#2]
IndiePath's render to texture module.


ImaginaryHuman(Posted 2007) [#3]
Render to texture really doesn't render to a texture, it renders to the backbuffer and grabs it into a texture.

To really render to a new targer you need something like a Frambuffer Object in OpenGL (if the extension is supported), which you can render to and then use as a texture. Otherwise you are left with something like the render-to-texture idea. Draw the texture grabbed from the previous frame to the backbuffer, modify it, re-grab it, draw the regular backbuffer, draw the grabbed texture on top, flip, clear the screen, repeat.


tonyg(Posted 2007) [#4]
Render to texture really doesn't render to a texture...

The DX code in the RTT module does.
For DX it creates a seperate texture which is set to the rendertarget rather than the backbuffer. The rendertarget is then reset to the backbuffer and the texture drawn.


Dreamora(Posted 2007) [#5]
Correct.
Its only the OpenGL one that uses the glcopy command.
Perhaps simpler as it is still worlds faster than the brute force approach with image -> pixmap ->image


ImaginaryHuman(Posted 2007) [#6]
Ahh, ok. Not cross-platform though ;-D


Dreamora(Posted 2007) [#7]
??

It is cross plattform.


On Windows you have both and on the other two operation systems you have the "crap compatible" approach with the glCopy
Most likely needed as crappies tend to have crappy GPU as well as they prefer "console" style, not? :)


tonyg(Posted 2007) [#8]
I use Diablo's HighGFX for OpenGL which still seems to work after all the Bmax changes.


Bremer(Posted 2007) [#9]
@tonyg , it seems like any of the threads with info on Diablos HighGFX the download links doesn't seem to work. If this is public domain could you either upload it to somewhere or send it to me on the mail shown in my profile?


tonyg(Posted 2007) [#10]
There was only ever a download so not sure how Diablo meant for it to be distributed.


Bremer(Posted 2007) [#11]
No problem, I have sent him an email to see if he responds.


ImaginaryHuman(Posted 2007) [#12]
I just mean that on OSX it doesn't render directly to the texture, there is an extra copy step.


Bremer(Posted 2007) [#13]
@tonyg, I have recieved answer back from Diablo, and he writes:


hi, ty for the interest

If tonyg has a copy of the library then I don't mind if he distributes it.

I thought I had a link to it somware but it appears that I don't so ask tonyg to email it to you.



I would have forwarded the mail recieved to you, but you do not have any contact info in your profile.

If you don't mind, I would appreciate if you would email me a copy, or if you could provide me with an email address where I could forward the answer from Diablo.


Diablo(Posted 2007) [#14]
Hi, I have finally managed to upload highgfx.

You can download it from:
http://www.fallenmoon.net/dump/highgfx.mod.rar

And if anyone else wants to mirror it then please do :D


Bremer(Posted 2007) [#15]
Thanks, I don't mind mirroring it.

http://zac-interactive.dk/mirror/highgfx.mod.rar