obviousjim / ofxSlitScan

slitscanning for openFrameworks
http://www.jamesgeorge.org/ofxslitscan/
36 stars 12 forks source link

fbo -> slitscan ? #1

Open JoshuaBatty opened 11 years ago

JoshuaBatty commented 11 years ago

Hey Jim, Awesome addon im just trying to work out how to send the texture from an fbo into ofxSlitscan. I am doing the following, drawing my scene in an fbo then converting that into an ofImage and trying to send it to slitscan.

fbo.readToPixels(pixels);
img.setFromPixels(pixels);
img.update();
slitScan.addImage(img);

slitScan.getOutputImage().draw(0, 0);

I am getting a bunch of [error] ofxSlitScan -- adding image of the wrong type

Would you be able to help me understand how I can tweak this to make it work?

Thanks.

obviousjim commented 11 years ago

hmm, wrong type means the pixel formats don't match. change between setting it up OF_IMAGE_COLOR_ALPHA or OF_IMAGE_COLOR?

On Sat, May 25, 2013 at 11:30 PM, JoshuaBatty notifications@github.comwrote:

Hey Jim, Awesome addon im just trying to work out how to send the texture from an fbo into ofxSlitscan. I am doing the following, drawing my scene in an fbo then converting that into an ofImage and trying to send it to slitscan.

fbo.readToPixels(pixels); img.setFromPixels(pixels); img.update(); slitScan.addImage(img);

slitScan.getOutputImage().draw(0, 0);

I am getting a bunch of [error] ofxSlitScan -- adding image of the wrong type

Would you be able to help me understand how I can tweak this to make it work?

Thanks.

— Reply to this email directly or view it on GitHubhttps://github.com/obviousjim/ofxSlitScan/issues/1 .

JoshuaBatty commented 11 years ago

Agh yep changing slitscan and ofImage to OF_IMAGE_COLOR_ALPHA did the trick! thanks heaps Jim!

JoshuaBatty commented 11 years ago

Hi back again, just wanted to ask if you had ever played around with making this into a GPU version....? I think for this technique to really shine then it shouldn't be limited to working on the CPU, meaning at the beginning of your processing chain instead of at the end after a bunch of post processing shader work. It should also be a heap faster as well if it were to run on the GPU. I saw that you liked -> https://vimeo.com/7878518 which say they have a 60fps realtime GPU slit scanner going. Honestly I have no idea where to begin with implementing this just thought id ask to see what your thoughts were on the matter. Cheers.

obviousjim commented 11 years ago

This would be pretty awesome and could be done with a large 3D texture as a circular buffer. Be a fun challenge, and yes, insanely fast. But ultimately bound by graphics memory which is much more limited than ram, so the trade off would be slitscans of bigger frame sizes (x y) with smaller z ranges.

On Thursday, August 15, 2013, Joshua Batty wrote:

Hi back again, just wanted to ask if you had ever played around with making this into a GPU version....? I think for this technique to really shine then it shouldn't be limited to working on the CPU, meaning at the beginning of your processing chain instead of at the end after a bunch of post processing shader work. It should also be a heap faster as well if it were to run on the GPU. I saw that you liked -> https://vimeo.com/7878518which say they have a 60fps realtime GPU slit scanner going. Honestly I have no idea where to begin with implementing this just thought id ask to see what your thoughts were on the matter. Cheers.

— Reply to this email directly or view it on GitHubhttps://github.com/obviousjim/ofxSlitScan/issues/1#issuecomment-22676435 .

JoshuaBatty commented 11 years ago

Awesome thanks for the reply. Would you be able to elaborate what you mean by a large 3d texture as a circular buffer. How does this differ in implementation from the video buffer existing in ofxSlitScan at the moment.? Sorry for the questions, I just think super fast slit scanning would just be too good to not find a way. thanks