Issue with jit.gl.imageunit and a texture using JS
Feb 25 2007 | 4:42 am
Hello List,
Using Javascript I am trying to have an jit.gl.imageunit process a jit.gl.texture with, e.g., 'bloom'-effect, but it does not seems to work, resulting in an empty window. There seems to be something wrong with the connection between the texture and the imageunit, because the imageunit itself can easily generate the 'sunbeams' as can be seen in the example.
I assume(d) imageunits and slabs work the same concerning how textures go in and out, or am I wrong? When I let a jit.gl.slab do the work in the same setting, it's all working properly. Since I'd like to use some imageunits-effects, I would really want to know which ingredient I am missing here.
First I tried it in Lua, but JS is giving me the same result.
Some advice would be really great.
Best,
Erik
Running the latest version of Jitter on a Mac Book Pro (10.4.8)
The script has an imageunit and a slab, the slab is disabled just as the imageunit's 'sunbeams'.
the js:
// save as: imageunit_js.js
autowatch = 1;
jtex = new JitterObject("jit.gl.texture","imageunit_js");
jtex.file = "colorbars.pict";
jwobbly = new JitterObject("jit.gl.imageunit","imageunit_js");
// enable one of those fx
//jwobbly.fx = "sunbeams" // this one works fine, since it doesnt need a texture
jwobbly.fx = "bloom" // this one needs a texture and does not work
// disable the imageunit above and enable the slab here
// jwobbly = new JitterObject("jit.gl.slab","imageunit_js");
// jwobbly.file = "td.wobble.jxs"
jwobbly.texture = jtex.name;
jwobbly.verbose = 1;
jvplane = new JitterObject("jit.gl.videoplane","imageunit_js");
jvplane.automatic = 0;
jvplane.transform_reset = 2;
jvplane.texture = jwobbly.out_name; //show the output of wobbly
function draw(){
jwobbly.draw();
jvplane.draw();
//post("drawn")
}
the patch: