which means 'repos coordinate is value of 'look' multiplied by the
size of first texture(texdim0) and then multiplied by the amount
look.ra means that shader uses only red&alpha channels.
this is where one of the differences between lumadisplace and repos
takes place - repos uses red channel to modify X coordinate and alpha
channel for Y coordinate - just like jit.repos.
near the end of the file you'll see:
vec4 repos = texture2DRect(tex0, coord);
this is where the first texture(first inlet of jit.gl.slab) is being
sampled for the final output, using the coordinates modified by the
So, this is a ruff overview of what's going on in td.repos.jxs. If you
want to modify it to use the luma value to offset both x&y
coordinates, you would need to first calculate the luminance of the
pixel, and then use it to offset both coordinates by the same amount.
Now you could take a look into saturation shader(cc.saturate.ip.jxs),
and see how luminance is calculated:
vec3 intensity = vec3 (dot(texColor, LumCoeff));
here they calculate the dot product between color and
'grayish'(LumCoeff) values. Lumcoeef is defined earlier in the shader
as a constant value:
So you could use these two lines to create a modified version of
td.repos.jxs - first you should duplicate the file and rename it to
Then you can open td.lumarepos.jxs, and start hacking by pasting the
lines for calculating luminance.
But you should take care not to brake the structure of jitter shader,
so first you could paste 'const' line after the 'uniform' declarations
and before void main() function.
Next step is to add the dot product calculation to your new shader.
In repos shader, 'look' variable contains color information of the
and now you have a lumadisplace&repos crossbred mutant shader!
But if you're not interested in learning glsl, then you can just
insert 'cc.saturate.ip.jxs' slab with '@param alpha 0.' between your
displacement texture and right inlet of slab contating td.repos.jxs
to achieve the same result:)
hope this helps,
On Jan 25, 2009, at 8:18 PM, Julien-Robert wrote:
> Ok, I've found how to use the repos.jxs shader. That's almost what I
> was looking for isn't?