QC GLSL shaders and movies

bytezen's picture

I am porting some of Mr. Doob's ( via Inigo Quilez) plane deformation shaders in GLSL.

I am able to get the shader working in QC on an image. However, I can't it to work on a movie file or with images from my iSight camera.

I have tried putting the Video Input patch inside of a Render In Image but that did not work.

Any thoughts or suggestions? Is this even possible?

I am including a version of the patch. Thanks in advance.

PreviewAttachmentSize
hypno_plane_deform_v1.qtz7.32 KB

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

gtoledo3's picture
Re: QC GLSL shaders and movies

Put a core image patch in between the video output and the glsl input?

I was testing something in 10.8 and it looks like this may be needed.

bytezen's picture
Re: QC GLSL shaders and movies

Thanks. I will give this a try and post my results.

Cheers,

bytezen's picture
Re: QC GLSL shaders and movies

Thanks! It works. It was as simple as you said. Vid->CoreImage (pass thru) -> GLSL.

I'm not sure why this is needed, but as I get more comfortable with QC maybe it will reveal itself. This seems a bit kludgy so I think I may just port the GLSL code to CI. Should be pretty straightforward from what I can tell thus far.

Cheers

gtoledo3's picture
Re: QC GLSL shaders and movies

bytezen wrote:
Thanks! It works. It was as simple as you said. Vid->CoreImage (pass thru) -> GLSL.

I'm not sure why this is needed, but as I get more comfortable with QC maybe it will reveal itself. This seems a bit kludgy so I think I may just port the GLSL code to CI. Should be pretty straightforward from what I can tell thus far.

Cheers

Well, it really shouldn't be necessary. My guess is that something in the Video output isn't outputting it's image correctly; maybe it's lacking some needed metadata, or there's some issue with pixel format. Or maybe the GLSL patch has gotten overly picky about the sampler type that is input.

A core image kernel always outputs the CIImage type, so it kinda converts some of the image data. I'd recommend eliminating the color multiplier so it's strictly a pass through. I'd also likely recommend sticking with GLSL, but you should maybe try a/b-ing? I tend to find that the GLSL performs a bit better than Core Image, but if you're just doing some lightweight image filtering, it may not make a measurable difference. You aren't getting much of a toll by using the Core Image kernel as a simple pass through at this point.

Either way, please file a bug. Also, if you do, please reply back here with the bug number. (I'm going to file a bug on this as well!)

bytezen's picture
Re: QC GLSL shaders and movies

Hey gtoledo-

~embarassing~ I don't know how to file a bug. I googled how to file QuartzComposer bugs but could nothing solid. I will definitely file it if you can point me in the right direction for instructions.
Cheers

(this is my attempt to start contributing to communities from which I have benefitted ;-) )

gtoledo3's picture
Re: QC GLSL shaders and movies

Oh ok! Well, you want to go to the Apple Developer website (https://developer.apple.com/devcenter/mac/index.action), and then sign up as a Mac Developer. You can get a baseline profile for free.

Then, you can log into bug reporter here - https://developer.apple.com/bugreporter/ ...after you've made a profile. :)