Forums > Jitter

jit.xfade behaves differently in jitter 1.6.3b (bug?)

December 20, 2006 | 5:14 pm

Hi all,

jit.xfade with a negative xfade argument when fading two gridshapes looks different in 1.6.3b compared to 1.5.2.

I included an example of this below. To reproduce, open and start the patch in jitter 1.5 and in 1.6.3b. Expected behaviour is that both outputs look as it does in 1.5.

I attached a screenshot of how it looks here.

Mac OS 10.4.8, Max 4.6.2 and 4.5.7, Jitter 1.5.2 and 1.6.3b

Does someone know of a way to make the output of 1.6.3b look like the one in 1.5.2?

Regards,
Mattijs


December 20, 2006 | 5:18 pm

Oops.. forgot to include the patch:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 147 29 83 196617 read dishes.mov;
#P newex 147 66 165 196617 jit.gl.texture pretty @name movie;
#P newex 147 46 97 196617 jit.qt.movie @vol 0;
#P newex 12 226 90 196617 jit.window pretty;
#P newex 30 173 114 196617 jit.xfade @xfade -0.35;
#P newex 48 149 404 196617 jit.gl.gridshape pretty @shape sphere @automatic 0 @matrixoutput 1 @color 1. 1. 1. 1.;
#P newex 12 92 66 196617 t b b b erase;
#P newex 12 71 57 196617 qmetro 40;
#P toggle 12 52 15 0;
#P newex 12 195 177 196617 jit.gl.render pretty @camera 0. 0. 3.;
#P window linecount 2;
#P newex 30 116 243 196617 jit.gl.gridshape pretty @shape plane @automatic 0 @texture movie @matrixoutput 1 @color 1. 1. 1. 1.;
#P connect 8 0 9 0;
#P connect 10 0 8 0;
#P connect 3 0 4 0;
#P connect 3 0 8 0;
#P connect 5 0 6 1;
#P connect 4 2 5 0;
#P connect 0 0 6 0;
#P connect 4 1 0 0;
#P connect 4 0 1 0;
#P fasten 4 3 1 0 71 112 17 112;
#P connect 6 0 1 0;
#P connect 2 0 3 0;
#P window clipboard copycount 11;


December 20, 2006 | 5:28 pm

Ah, appears it also happens with xfade > 1. Screenshot attached.

Mattijs


December 20, 2006 | 6:21 pm

this looks like its a textureing issue only – the geometry looks the
same – maybe xfade hasnt changed, but the texture coordinates being
output by the matrixoutput 1 from the object you are using?

it use a jit.print and see what you find – id do it, but I dont have
1.5 on my intel system :)

On Dec 20, 2006, at 12:28 PM, Mattijs Kneppers wrote:

> Ah, appears it also happens with xfade > 1. Screenshot attached.
>
> Mattijs
> –
> SmadSteck – http://www.smadsteck.nl
> Interactive audiovisual sampling soft- and hardware
>
>

v a d e //

http://www.vade.info
abstrakt.vade.info


December 20, 2006 | 7:15 pm

i once thought matrixoutput outputs only vertex geometry. good to know.
ill just move along now.

On 12/20/06, Mattijs Kneppers wrote:
>
> Ah, appears it also happens with xfade > 1. Screenshot attached.
>
> Mattijs
> –
> SmadSteck – http://www.smadsteck.nl
> Interactive audiovisual sampling soft- and hardware
>
>
>
>
>
>
>


December 21, 2006 | 10:54 pm

There’s nothing wrong with jit.xfade. There has been a change from
1.5 to 1.6 in how texture coordinates for planar forms are generated.
This was done to make things consistent with displaying video properly
when some bug fixes were made to jit.gl.texture. If you lookat plane
3 of the matrixoutput from the gridshapes, you will see a different
between the sphere and plane. When they are xfaded together, the
texcoords extrapolate and go negative, creating the clamp to border
effect you see. If you want it to look the same as before, simply use
the same texture coordinates for both gridshape matrixoutputs. In
other words, one of them has to have its data replaced with the
other’s for planes 3 and 4.

Alternatively, you could generate the same forms with jit.expr and use
jit.gl.mesh to render everything like in this patch:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 453 294 30 196617 t b b;
#P newex 453 273 48 196617 loadbang;
#P message 195 255 34 196617 reset;
#P newex 195 274 197 196617 jit.gl.handle pretty @inherit_transform 1;
#P newex 279 454 252 196617 jit.expr 2 float32 20 20 @expr "norm[0]" "norm[1]";
#P newex 231 478 395 196617 jit.gl.mesh pretty @texture movie @color 1
1 1 1 @position 3 0 0 @rotate 180 0 0 1;
#P newex 231 414 114 196617 jit.xfade @xfade -0.35;
#P newex 231 369 216 196617 jit.expr @expr "-snorm[0]" "-snorm[1]" "0";
#P newex 231 347 130 196617 jit.matrix 3 float32 20 20;
#P button 453 319 15 0;
#P window linecount 2;
#P newex 453 369 269 196617 jit.expr @expr
"cos(snorm[0]*PI)*sin(norm[1]*PI)" "sin(snorm[0]*PI)*sin(norm[1]*PI)"
"cos(norm[1]*PI)";
#P window linecount 1;
#P newex 453 347 130 196617 jit.matrix 3 float32 20 20;
#P message 170 56 83 196617 read dishes.mov;
#P newex 170 93 165 196617 jit.gl.texture pretty @name movie;
#P newex 170 73 97 196617 jit.qt.movie @vol 0;
#P newex 35 324 90 196617 jit.window pretty;
#P newex 53 253 114 196617 jit.xfade @xfade -0.35;
#P newex 157 180 404 196617 jit.gl.gridshape pretty @shape sphere
@automatic 0 @matrixoutput 1 @color 1. 1. 1. 1.;
#P newex 35 119 66 196617 t b b b erase;
#P newex 35 98 57 196617 qmetro 40;
#P toggle 35 79 15 0;
#P newex 35 300 257 196617 jit.gl.render pretty @camera 1.5 0. 6.
@lookat 1.5 0 0;
#P window linecount 2;
#P newex 53 143 243 196617 jit.gl.gridshape pretty @shape plane
@automatic 0 @texture movie @matrixoutput 1 @color 1. 1. 1. 1.;
#P connect 11 0 12 0;
#P fasten 13 0 14 0 458 340 236 340;
#P connect 13 0 11 0;
#P connect 22 0 13 0;
#P fasten 22 1 13 0 478 315 458 315;
#P connect 21 0 22 0;
#P fasten 12 0 16 1 458 406 340 406;
#P connect 18 0 17 1;
#P fasten 16 0 18 0 236 440 284 440;
#P connect 16 0 17 0;
#P connect 15 0 16 0;
#P connect 14 0 15 0;
#P connect 20 0 19 0;
#P connect 8 0 9 0;
#P connect 3 0 4 0;
#P connect 3 0 8 0;
#P connect 10 0 8 0;
#P connect 5 0 6 1;
#P connect 4 2 5 0;
#P connect 0 0 6 0;
#P connect 4 1 0 0;
#P fasten 4 3 1 0 94 139 40 139;
#P connect 4 0 1 0;
#P fasten 19 0 1 0 200 295 40 295;
#P fasten 6 0 1 0 58 285 40 285;
#P connect 2 0 3 0;
#P window clipboard copycount 23;


December 22, 2006 | 10:54 am

Quote: wesley.hoke@gmail.com wrote on Thu, 21 December 2006 23:54
—————————————————-
> There’s nothing wrong with jit.xfade. There has been a change from
> 1.5 to 1.6 in how texture coordinates for planar forms are generated.
> This was done to make things consistent with displaying video properly
> when some bug fixes were made to jit.gl.texture. If you lookat plane
> 3 of the matrixoutput from the gridshapes, you will see a different
> between the sphere and plane. When they are xfaded together, the
> texcoords extrapolate and go negative, creating the clamp to border
> effect you see. If you want it to look the same as before, simply use
> the same texture coordinates for both gridshape matrixoutputs. In
> other words, one of them has to have its data replaced with the
> other’s for planes 3 and 4.

Ah, thanks a lot wesley, both for the explanation and the alternative. Seems the latter allows for a lot of funky jamming, I will have to have a closer look at the possibilities of jit.expr in combination jit.gl.mesh.

Thanks,
Mattijs

To be complete here is the patch with wes’ first solution implemented:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 47 186 66 196617 jit.unpack 4;
#P newex 37 229 157 196617 jit.pack 12;
#P newex 37 206 170 196617 jit.unpack 12;
#P flonum 140 165 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 88 165 50 196617 xfade $1;
#P message 154 36 83 196617 read dishes.mov;
#P newex 154 73 165 196617 jit.gl.texture pretty @name movie;
#P newex 154 53 97 196617 jit.qt.movie @vol 0;
#P newex 19 274 90 196617 jit.window pretty;
#P newex 37 165 49 196617 jit.xfade;
#P newex 55 143 404 196617 jit.gl.gridshape pretty @shape sphere @automatic 0 @matrixoutput 1 @color 1. 1. 1. 1.;
#P newex 19 86 66 196617 t b b b erase;
#P newex 19 66 57 196617 qmetro 40;
#P toggle 19 48 15 0;
#P newex 19 252 177 196617 jit.gl.render pretty @camera 0. 0. 3.;
#P window linecount 2;
#P newex 37 110 243 196617 jit.gl.gridshape pretty @shape plane @automatic 0 @texture movie @matrixoutput 1 @color 1. 1. 1. 1.;
#P connect 0 0 6 0;
#P connect 0 0 15 0;
#P connect 15 3 14 3;
#P connect 13 11 14 11;
#P connect 13 10 14 10;
#P connect 13 9 14 9;
#P connect 13 8 14 8;
#P connect 13 7 14 7;
#P connect 13 6 14 6;
#P connect 13 5 14 5;
#P connect 13 4 14 4;
#P connect 13 2 14 2;
#P connect 13 1 14 1;
#P connect 13 0 14 0;
#P connect 6 0 13 0;
#P connect 8 0 9 0;
#P connect 10 0 8 0;
#P connect 12 0 11 0;
#P connect 5 0 6 1;
#P connect 4 2 5 0;
#P connect 11 0 6 0;
#P connect 4 1 0 0;
#P fasten 4 3 1 0 78 106 24 106;
#P connect 4 0 1 0;
#P connect 14 0 1 0;
#P connect 2 0 3 0;
#P connect 3 0 8 0;
#P connect 3 0 4 0;
#P window clipboard copycount 16;


Viewing 7 posts - 1 through 7 (of 7 total)