Buffer Effects?

BlitzMax Forums/BlitzMax Programming/Buffer Effects?

ninjarat(Posted 2007) [#1]
Hey, I was wondering, how do you get direct access to the D3D/GL buffers in Max2D? I really would like to do some buffer effects in my game like motion blur, maybe ripple...anyone got wisdom to share?


ImaginaryHuman(Posted 2007) [#2]
In GL look at glCopyTexSubImage2D() as a compatible and fairly fast way of copying an area of the backbuffer into an *existing* texture.

You might also try playing with the accumulation buffer.


ninjarat(Posted 2007) [#3]
How exactly does the accumulation buffer work?


RiK(Posted 2007) [#4]
Ninjarat, is it really necessary to have a 13 line signature on a 1-line post?


ninjarat(Posted 2007) [#5]
Okay, I crunched the signature down. Now, how about blur effects and such?


Dreamora(Posted 2007) [#6]
You have to do the great thing known as Implement it.
If the question is how, check out 3d programming oriented boards which most likely have some simple examples.
Although, most of them won't work. No one is using buffers for that or buffers only. Shaders are the way it is done and thats something not supported in BM.


ImaginaryHuman(Posted 2007) [#7]
Read the OpenGL red book online.


FlameDuck(Posted 2007) [#8]
Shaders are the way it is done and thats something not supported in BM.
Rubbish.


ninjarat(Posted 2007) [#9]
@FlameDuck - Be NICE.
@Dreamora - Don't be so defeatist. It can someday.

Anyway, I think I phrased my question wrong anyhow. What I should have said was: How do you get direct access to the drawing surface or even better render to texture, without severely interfering with Max2D.


tonyg(Posted 2007) [#10]
Motion Blur : Might want to draw 5 'ghost' images with decreasing alpha.
Blur : Might want to load image with MIPPEDIMAGE, setscale 0.25,0.25, grabimage, draw at 4.0,4.0 and grabimage. It blurs OK but, for small images, might be quicker to use writepixel.
Not sure about ripples other than using writepixel or predefining them.
If shaders are possible it'd be nice to see an example since they were first tested a couple of years ago.
If we're nice to IndiePath he might distribute his RTT module for 1.24
It'd be really really nice for some official enhancements to Max2D though.