How does shader work ?

Hi,

All of my newbie question is in the title…

How does ofShader work ?
Is there a good book/tutorial/examples to learn shader coding ?
Does it could be the same way to code shading in OF, in vvvv, and all others creative code using openGL ?

Thx in advance to all of world champions who will take time to answer and help me.

Sebastien

yes, OF just takes the shader, compiles it and uploads it to the graphics card, so no matter what tool you use the shader will be the same

Hi,

Thx for reactivity
My question was also about advices on shader coding, tutorials websites…
and also good books to learn shading behind fireplace drinking 30years whiskey :slight_smile:

I put also another question/advice request in the post.
If my graphic designs are mainly simple shapes, vectors designs and 2D forms, does it relevant to use shader ?
Shader coding is powerful to have beautiful visual effects (blur, shine and so on), but does it work well with 2D approach, is it better to work directly on pixels arrays ?

Sebastien

shaders are useful tools also when handling 2d/video: they can be used to create “effects” (blurring, filtering, etc) or to create a paticular rendering style.

the bad news is that I never found a beginner tutorial that was really easy for a beginner; the standard readings on the subject are http://www.lighthouse3d.com/opengl/glsl/ and the orange book

There aren’t a ton of good tutorials on learning shaders, but there are some neat tools out there for playing with in an easy way, espeically some WebGL ones, that should help you understand what a shader is and how it works.

Even though a lot of this is based on webGL/javascript, the parts that actually explain shaders and their syntax are quite good: http://www.html5rocks.com/en/tutorials/webgl/shaders/

This is awesome, but quite complex too: http://www.iquilezles.org/apps/shadertoy/

Some good OF shader projects here:

https://github.com/kylemcdonald/3dsav/tree/master/week4

Hmm, I put up some links to WebGL resources that I guess got flagged as spam and weren’t accepted (too many links perhaps?). The one I was thinking was a pretty nice intro resource was: www.html5rocks.com/en/tutorials/webgl/shaders/

Also (apparently I can’t link to them) if you search for “webgl shader toy” you’ll find some live-time, relatively easy to use toys that will help you learn a little more about how fragment and vert shaders work without needing to run an OF program each time. The underlying tech is really different, but GLSL is the same.

@josh, just unflagged your message, it was caught by the spam filter