system
February 28, 2005, 9:06pm
1
i try to write filter, which is doing some operations on correponding pixels of on my opengl window.
it`s looking like:
render_stuff
glReadPixels(…)
do_some_operations_on_readed_table
glWritePixels(…)
wglSwapBuffers(…)
jump to render_stuff
but its not working, and it
s slow like hell…
maybe someone did it before me? i will be very grateful for any kind of help.
system
February 28, 2005, 9:14pm
2
and… i forgot: no shaders. i`ve got riva tnt2…
Getting data back from the GPU is always extremely slow.
If you can’t use shaders, I’m afraid you are out of luck here. The normal procedure to do this kind of operation is:
render scene to a texture
render a fullscreen quad using the texture and a postprocessing shader
If the operation is simple enough, perhaps you could use combiners and/or a multipass algorithm with blending to perform it.
system
March 1, 2005, 6:05am
4
but still i can:
render scene to a texture
do some operations on the texture, like xor or and
render a fullscreen quad using the texture
and it still should be fast…?
You can’t directly modify a texture, the only thing you can do is render it. But of course you can render a fullscreen quad with the texture and use for example glLogicOp(GL_XOR).
I don’t know how fast glLogicOp is on a TNT2, but I think it’s worth trying it out.