shader not working
Can anyone figure out why this shader isn’t working?
simulates the flickering of a television screen
uniform float amount;
uniform sampler2DRect tex0;
uniform sampler2DRect tex1;
varying vec2 texcoord0;
varying vec2 texcoord1;
vec4 a = texture2DRect(tex0, texcoord0);
vec4 b = texture2DRect(tex1, texcoord1);
gl_FragColor = mix(a,b, amount);
can you provide a test patch? nothing looks amiss here to me.
When you say "isn’t working", what isn’t working about it? I imagine it probably doesn’t live up to "simulates the flickering of a television screen", but beyond that it looks fine.
No error messages; it just doesn’t appear to be doing anything- I just see the video passed through jit.gl.slab’s right inlet with no apparent alterations.
Andrew, I’m testing this with the patch from your "Your First Shader" article with another jit.qt.movie hooked up to the right inlet of jit.gl.slab.
I’m not sure I have the math correct for my desired effect, which is roughly the below patch, but figured *somthing* would happen.
----------begin_max5_patcher---------- 397.3ocyTFsaBCBFE9Z5SAgamy.Tq51UaOGKFC1xlXZglVz0Miu6q.sZ0zo0 rXcWTZ5gefuygBa8.nEpBdNB9L7MH.r0C.rRFAP02.TBqHLlkaKCI4epVrBM v0klWnsxqD5gILclnntq2URct3atoaBcHtRVsVGy05uR4tU0Lx40iDhPvYUE lxzgKExOlmwC0tZISwkyCjDPLuBBLszRo8iQDYgoDvGISaBhjkXWOzqYBVbc Ox0IBYIMVmQNH5XzpRMh677LMC96QTnRtQEugeKCIpMcnA9lWSvmKjnWYFQ6 iLRkBeo74gaXF4REe+Q1H57+GQtaYjcNQ+lcOqAexuwIj8ss5Obqt.2pKpOi DpRR3R2VFpecFY7zNaM+6f0bSI5h+6MYbGLvnq3lJ7ELfcAPwB4o22aYzner qxUqyBq2Rptr.d.yHdtVHYZgR1nFyoEHYeQKEQQbYS5RDQoJgTWw.bVqQbWQ xbI+EYh1uH42kX5Xtu4LQ5BSi5Wlvcbq6eFRmjkWGSkery6GdY6Jz. -----------end_max5_patcher-----------
change the line
this tells the shader to bind tex1 to the second slab input.
Thanks, Rob. That solves it. Now I can play with the math a little.
Forums > Jitter