I am testing the new features of Codea, shaders,…what can I say, it is more than fast, epic!
I am thinking about create a place to share shaders in the forum, this must be the right place.
So ,hands up, I took the “Shaders” example from Codea 1.5(4), and add after iparameter(“Texture”…) in function setup():
parameter("R", 0,1,1)
parameter("G", 0,1,1)
parameter("B", 0,1,1)
Then, in function draw() , add after --configure out custom uniforms for the ripple shader:
m.shader.r = R
m.shader.g = G
m.shader.b = B
You just have to define the vars in the fragment tab inside the amazing shader editor, I have made a copy of ripple and named it colorize ripple, add in fragment the definitions:
uniform highp float r;
uniform highp float g;
uniform highp float b;
we got the bridge done, just use it with the replacement of gl_FragmentColor to colorize with our parameters the texture obtained by the ripple main function (Fragment):
gl_FragColor = vec4(vec3(r,g,b)*vColor.rgb*col.rgb, col.a);