Wave GLSL with Image Texture

gtoledo3's picture

I rewrote the shader here ( http://gpwiki.org/index.php/OpenGL:Codes:Simple_GLSL_example ) to have an image input for texture, and it's sort of fun, so I'm posting it here.

PreviewAttachmentSize
Wave GLSL with Image Texture.qtz4.78 KB

usefuldesign.au's picture
Re: Wave GLSL with Image Texture

It's getting like I wonder about an idea for a comp and you post it, George. With all the WorldCup madness I was thinking about how to make flag-waving comp (if only to prove Australia does actually exist!) and translating the photoshop way of doing it into a CIFilter. GLSL is of course a better approach if you have the know-how! Shading is the next step… if I may be so bold.

Would like to try some displacement mapping with esher-esc patterns (like the fish going both ways ones) if you want too. I guess it's kind of like that droste example you converted for OpenCL (which saddly I can't touch)

cybero's picture
Re: Wave GLSL with Image Texture

Nice wavy flag, gtoledo3.

So, what's with the OpenCL Droste?

Faster than the CoreImage Droste?

usefuldesign.au's picture
Re: Wave GLSL with Image Texture

cybero wrote:
So, what's with the OpenCL Droste?
Sorry got my wires drossed on that one, that was the post you made, cybero and yeah, it's CI as I now read it again.

cybero's picture
Re: Wave GLSL with Image Texture

Ah, I see.

Well in that case, no OpenCL Droste, not as yet. My Droste_OpenCL is still to render reliably at all. Definitely a work in progress.

BTW - seeing as how OpenCL does not support recursion natively, I'd been trying to zip together an OpenCL array or image processing kernel with a vertex recursive shader. Will post results once reliably achieved.

cybero's picture
Re: Wave GLSL with Image Texture

& back to that's a nice 'flag'. The shader stops being so obviously flag wavy when asked to render a simple sine wave structure. See attached. I think it works really neatly for stuff like that.

Thanks for sharing.

BTW.

The Droste / OpenCL confusion (code wise pertinent to GLSL and shaders more than OpenCL], has been moved elsewhere to where it is pertinent. :-))

FYI.

As it happens this shader offline renders very steadily, as you know, some don't.

PreviewAttachmentSize
Wave_GLSL_with_Image_Texture_Structures.qtz14.75 KB

leegrosbauer's picture
Re: Wave GLSL with Image Texture

Useful! Thanks!

gtoledo3's picture
Re: Wave GLSL with Image Texture

That Droste example, which is an Apple Dev Example, actually works in 10.5.8+(and probably earlier), so you should definitely check it out.

Strangely enough, I KNOW I have a CI Filter setup that does a flag wave. I was digging around for it earlier today, when I saw your post, but can't find it off the bat.

I would like to get this going to take advantage of a lighting environment, but the way this is approached is ultra simple, and isn't setup to do that really.

It's fun to get a handle on all of the things that you can and can't do with GLSL (which is convoluted by the subset that works in QC). That said, the combination of a Kineme3D Plane, something like a twister+ripple warp, and smoothing on the renderer, blows this out of the water, in my opinion. The cool part of this one is that it's stock, and it does have a slightly unique visual quality.

gtoledo3's picture
Re: Wave GLSL with Image Texture

If you get it "ripply", texture it with some good rock type texture png's, and turn it on it's side (-80ish?), you get some quick mountains or terrain... which is a pretty good utilitarian use.