GLSL Shaders

jersmi's picture

I thought this deserved a new post, but it started here: http://kineme.net/forum/Discussion/General/photoshopstylelevels

These GLSL shaders come from vade's link here: http://001.vade.info/?page_id=20

Attached is a qtz with most of the GLSL shaders listed on vade's site.

I know this is old news to many experienced users, but for those like me who are just getting into this body of knowledge, these might be helpful.

In regards to practical use, acouple things: the way these shaders are put together (parameterized), one gets the feeling they were created with an eye towards users in the visual arts field. I appreciate this because some QC tools are set up in ways that are not as intuitive for me, or require additional setup. (One might get the feeling that computer programmers may not always know what's best for users in the field. ;)

Also, some of the tools overlap, but I find it nice that these shaders params can be adjusted beyond the scale imposed by Apple. (This always drives me a little nuts -- let me make up my own mind, please. If I blow up my computer, so be it!)

And last but not least, as with all vade's work, these are high quality.

PreviewAttachmentSize
GLSL_Shaders.qtz80.24 KB

vade's picture
Re: GLSL Shaders

Ha. That was fast. There are actually some bugs with the GLSL patch that make me tend to avoid it for some more complicated things. This afternoon I have working QC plugin variants of Channel Mixer, and a proper PS style Levels (using a different method sans LUT). I also have a somewhat decent homegrown version of Vibrance, which is a nice saturation that tapers off, rather than blowing out color saturation.

cwright's picture
Re: GLSL Shaders

jersmi wrote:
(One might get the feeling that computer programmers may not always know what's best for users in the field. ;)

That's sadly a two-way street; Users in the field may not always express what's necessary to developers. If I were to count the number of times someone pointed out a bug, said "I'll file a radar on that," and then didn't, I'd probably run out of numbers. If I were to count the number of times a non-programmer gave meaningful advice on their needs, it'd be a really really small number (but non-zero!). Communication (esp. between highly-technical programmers and highly-abstract designers) is extraordinarily difficult, and people of all fields don't seem to focus on it in proportion to how powerful it can be :/

That said, I totally agree with you that the current GLSL shader that QC provides is exceptionally raw (and pretty useless too -- a shader that only textures an object? meh). I'm all ears on hearing what you think should be provided, and how. And by "all ears" I mean: seriously, I want to hear what people want, how they want it to work, etc. -- I make absolutely no promises due to a million other constraints I have to deal with, but making this sort of power accessible is what QC's all about, so polishing it up a little bit can go a long way in my opinion, so it's justified effort.

jersmi wrote:
Also, some of the tools overlap, but I find it nice that these shaders params can be adjusted beyond the scale imposed by Apple. (This always drives me a little nuts -- let me make up my own mind, please. If I blow up my computer, so be it!)

Can you elaborate on where scales are imposed? The only place I'm aware of is on CoreImage filters, and those are imposed by CI for several reasons. QC allows you to bypass those limits with splitters (though it's rather opaque and not publicly addressed/documented, sadly), so you can have your cake (unlimited whatever filters), and eat it too (CI's safety net limits come into play by default to keep their filters behaving as they intend them to).

cwright's picture
Re: GLSL Shaders

What kind of bugs have you experienced with the GLSL Shader patch?

vade's picture
Re: GLSL Shaders

gl texture matrix in the vertex shader, for any unit higher than 0 does not work properly.

cwright's picture
Re: GLSL Shaders

radar'd? with sample composition? I've run into that too, come to think of it, but I always worked around it by just using the same sized textures (which always worked out ok for my needs, but isn't a good solution overall)..

vade's picture
Re: GLSL Shaders

I thought i had put in a bug for that. Ill try and submit one this week. Sorry, I'm usually good about that. I know I discussed on the list some time way back when.

Will I be meeting/seeing you at WWDC? :)

cwright's picture
Re: GLSL Shaders

You probably have, but I wasn't sure (and was too lazy to dust off my work machine to do a search ;). If it's in there, no worries, I'm just curious so I can CC myself on it and take a closer look. I also remember it being discussed on the list at some point, but completely forgot it was a bug until you brought it up again :) (I just kinda ignored it as "That's just how it is" -- I carry a lot of that over from my kineme days, where I couldn't change core stuff without an epic fight :)

I don't know how much I can say about WWDC yet, but I'll be there ;) (I'm planning on doing another WWDC post in the typical kineme.net tradition to see who all's going -- I hope I don't get punched in the face too much for the GL Tools blending problems on Snow Leopard...)

dust's picture
Re: GLSL Shaders

wow these are awesome. i totally was going to check them out when i saw vades 001 link in the ps level thread but was like rrr oh man make me open up max. i guess i haven't used max as much as i used to... i should get back into now that i have taken a class in java. one of these days i'm going to make a qc max live patch via dips4. i guess now that qc works with max and max with ableton its sensory overload and i don't know where to begin. i guess that comes with being an artist.

as per the whole user / developer non intuitive thing. i kind of agree in respects to usually there is or are two types modalities in reference to the designers mind and the developers mind. usually people are one or the other. either engineer or artist. rarely are people of both mind sets.

in contrast take vade for example he is a talented designer and programmer. im not sure which came first but from my experience and making observations on campus it is easier for a designer to become a coder and have the best of both worlds where as its harder the other way around.

so i would say using vade as an example again...he knows what users need with all the v002 and webkit stuff. i know his movie player is a great example of what users needed in regards to the vj community.

i would say the kineme forum is the best platform letting people know the users needs. i sure as hell know i ask a lot of dumb questions and equally offer solutions to hard ones.

all i have to say is qc is very intuitive in comparison to trying to do what qc can do in hard c code. with the exception of open frameworks they make gl programming pretty intuitive.

jersmi's picture
Re: GLSL Shaders

"cwright" wrote:
Can you elaborate on where scales are imposed?
I will keep this on my radar and post back when examples come up. It's late here and the work week begins tomorrow. Come to think of it, I'm probably thinking of CI filters, and I have noticed only recently that input splitters address this but didn't think of that when I posted.

I realize it's a two way street between devs / users. I'm not sure what I would change except to impose a direct channel for creative users to your office at Apple, Chris. (I guess that's what conferences are for, eh?). I'm speaking more of what dust wrote about two mindsets -- artist / coder (<-- deliberately not using "versus"). This is not so much a matter of bug reports, but two worlds operating in parallel. It's not a matter of things being broken, because what we are talking about exists when the tools work as designed. There is however a sense at times of repurposing tools that were meant for other things (examples needed, just a sense with QC). QC has a side that is meant to help coders making software for the OSX platform. I personally think this is fascinating and in no small way Apples support lends stability to the tool. For example, Jitter (and max/msp) have a lot of arcane patches that QC does not have, and that's good.

A general suggestion that comes to mind: mine the history of video art and give us tools to create these things. I know I know, just a thought to provoke without examples to back it up at present...

And dust, I'm with you. You seem to be bridging these worlds as well. I see what vade posts about what he's up to in NYC. He uses his tools in a public arena, field tested, etc. No small thing. QC just happens to be an awesome tool for artists as well. It is my tool of choice. Actually I feel I am not experienced enough to be intelligently critical (yet). Usually where there's a will there's a way for me.

And thanks again, Vade. Your work influences many.

jersmi's picture
Re: GLSL Shaders

And, Vade, I would love to see these new tools, of course. I mostly operated out of curiosity and did check most of the shaders to see they worked, except for the mixers and 3D, but it was really a power copy / paste episode waiting for more careful exploration. So forgive if there are any that come up null. Shouldn't, pretty sure (does the "tex0" have anything to do with what you say about not using these?)

Btw, the channel mixer looks a lot like the built in Color Matrix. Differences? I might like your GLSL shader better, but haven't lived with it yet.

vade's picture
Re: GLSL Shaders

Ha. You know, sometimes I get lost in plugin land and forget that some built in tools do similar things. They are very alike, not exactly the same but close. Hm.

jersmi's picture
Re: GLSL Shaders

Attached is a simple mod of the GLSL Mirror so that the image stays centered.

cwright -- the GLSL Posterize might be an example of ease of use vs CI Filter -- using QC's gaussian gradient patch, the CI Posterize doesn't work, but the GLSL does. Maybe there's a way to get the CI version to work, but I don't know how.

And Vade, a request for a plugin: channel blur, ala after effects. I was poking around in CI wondering about it, but I'm still such a hack.

PreviewAttachmentSize
GLSL Mirror2.qtz2.48 KB

vade's picture
Re: GLSL Shaders

Unfortunately due to my current employment, a public, open source channel blur is not going to happen from me. Fortunately, due to my employment, usable Image Unit based set of (really fast, really high quality, channel and per pixel, masked) blurs is... .. forthcoming. I can't say much more than that :)

cybero's picture
Re: GLSL Shaders

That [ ..forthcoming] is definitely worth watching out for :-).

jersmi's picture
Re: GLSL Shaders

Sounds awesome!