Page 1 of 2
FFGL access texture data
Posted: Mon Jan 12, 2009 16:33
by Logarith
Hi,
is there a possibility to temporarily save the frame texture data for several Frames.
I tried to save it in a variable in the fragmentshader but that didn't work.
Is there a possibility inside the processOpenGL method to access the data directly?
Greetings
Flo
Re: FFGL access texture data
Posted: Tue Jan 13, 2009 16:12
by edwin
Hi Flo,
You can do such a thing in a fragment shader and neither does FFGL give have access to the original texture data. You can however create multiple textures yourself and copy the content of the framebuffer in it if you like.
So render a quad with the texture and then copy it to a texture using glCopyTexSubImage2D.
Re: FFGL access texture data
Posted: Wed Jan 14, 2009 19:31
by Logarith
Thx Edwin,
it worked with glCopyTexSubImage, after several hours experiencing a lack of opengl knowledge
Greetings
Flo
Re: FFGL access texture data
Posted: Wed Jan 14, 2009 19:35
by edwin
Cool, what kind of plugin are you building?
Re: FFGL access texture data
Posted: Wed Jan 14, 2009 20:00
by Logarith
A fried of mine wanted a "stop motion" plugin which he told me was available in
Resolume 2 but not in 3.
Simply it holds the same frame for a specific time. The other frames are
cut out.
Dont know if I did the same thing as he wanted, sended it to him and I'll wait
for his answer if I did it correct.
Re: FFGL access texture data
Posted: Thu Jan 15, 2009 09:20
by edwin
Ahh.. i wanted to add that plugin mylelf as well. But so much todo, so little time.
Did you create other plugins as well, it's allways nice to see other people working on FreeFrame plugins.
Re: FFGL access texture data
Posted: Thu Jan 15, 2009 10:01
by Logarith
No, this was my first plugin. But I have some cg courses in university so this is an interesting practice for me and I surely will develop others.
My friend liked the plugin very much, but he discovered an error which I dont know how to solve.
The problem is that if you use the effect, bypass it, change the clip and then check the bypass out for a short time frames of the old clip are shown. He said this was sometimes in Resolume 2 but he didnt see it til now in Resolume 3. To solve the problem, it would be necessary to know in the ProcessOpenGL method if either the clip has changed or if bypass has been pressed. Another possibilty would be the setTime method. But as I heard it isnt supported by Resolume at this time.
Greets flo
Re: FFGL access texture data
Posted: Mon Jan 19, 2009 10:55
by edwin
The problem you mention will only occur when you use the effect on a layer or the composition. When applied to a single clip this won't be a problem. We've encountered similar problems.
The time feature hasn't been implemented by us yet, we will add this in a later stage. Right now you can check if processOpengl ( if plugin is bypassed the processOpenGL function isn't called) is called and keep track of the time yourself, if the time between callls to processOpenGl is called is bigger then a certain period you can take action. That would be a solution, there is no way at the moment to tell the plugin now that it's bypassed.
Re: FFGL access texture data
Posted: Wed Feb 11, 2009 16:38
by Rene
Hello,
do you think it makes sense to store texture data in a pixel buffer object (PBO) to increase performance? I'm not sure, but I guess usually texture data stored in a buffer is written back to the host's RAM, isn't it?
At startup Resolume checks for some OpenGL functions, does it check/require ARB_pixel_buffer_object extension to run?
Re: FFGL access texture data
Posted: Thu Feb 12, 2009 09:06
by edwin
We do check for the ARB_pixel_buffer_object extension but it's not a reason not to run.
A pixel buffer resides in VRAM, the pixel_buffer allows you to handle VRAM much like you would use normal RAM.
You can also just use glCopyTexImage to copy contents of the current framebuffer to a texture and use it whenever you need it again.
But tell me what you want to accomplish and maybe i can give you a direction in which to look.