Forums > Jitter

loading pictures without glitches

October 5, 2006 | 2:00 pm

Hello

I’ve got a folder of pretty high-res pictures that I’m loading into a jit.matrix. This is done from an ubumenu. These pictures are then used as a texture, and animatad with openGL-stuff. All the pictures have different dimensions, but are at least 300dpi, but the matrix I load them into is 1024×1024, – which of course messes up the proportions.

Problem is that each time I load a new picture, the animation hangs for a second. Could someone please instruct me on how I can avoid this.


October 5, 2006 | 2:06 pm


October 5, 2006 | 3:12 pm


October 6, 2006 | 10:53 pm

Ooops. My flaky internet connection made me post this in two topics. Sorry.

Anyway. Made a small performance yesterday, and my workaround was to have ten different jit.matrix objects, with preloaded pictures, and using ‘switch’ to choose picture. That worked ok, but I initially had ca 100 pictures, and that method is inefficient.

I’ve searched, and tried to find out how to use jit.matrixset, but haven’t succeeded.

Should have prepared my pictures to be 1024×1024 on forehand, but didn’t have the time. Should have prepared them in many different ways I guess, but… time.


October 6, 2006 | 11:06 pm

>
> Anyway. Made a small performance yesterday, and my workaround was
> to have ten different jit.matrix objects, with preloaded pictures,
> and using ‘switch’ to choose picture. That worked ok, but I
> initially had ca 100 pictures, and that method is inefficient.

Btw, I’d recommend that you check out jit.qt.movie’s asyncread
message which loads a movie (or image) in a background thread.
Probably need at least two instances in this case, since you may want
to use one while the other is loading in the background…

-Joshua


October 7, 2006 | 12:47 pm

Thanks, yes. Using asyncread made things better, but still it seems to be some glitches in the animation, – probably when the picture is big.

I guess I should adapt one of the mentioned methods. Loading them onto GPU, as mentioned in another thread, or using matrixset.

This is my take on the jit.matrixset. Which seems to be a nice method if I prepeare my pics. No glitches;)

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 294 141 20 196617 50;
#P message 296 125 20 196617 98;
#P message 347 228 35 196617 write;
#P message 284 226 30 196617 read;
#P number 128 47 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user jit.pwindow 80 260 322 242 0 1 0 0 1 0;
#P button 95 47 15 0;
#P newex 95 81 44 196617 uzi 100;
#P newex 125 104 40 196617 t b i i;
#P newex 81 237 170 196617 jit.matrixset 99 4 char 1024 1024;
#B color 5;
#P number 221 152 35 9 0 99 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 218 177 111 196617 outputmatrix $1 , bang;
#P number 155 134 35 9 0 99 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 155 153 45 196617 index $1;
#P user ubumenu 49 134 100 196617 0 1 1 0;
#X add pictures in a folder;
#X types TIFF JPEG TIFF JPEG;
#X prefix_set 0 0 0;
#X pattrmode 1;
#P newex 81 176 105 196617 prepend importmovie;
#B color 5;
#P window setfont "Fixedwidth Serif" 10.;
#P newex 81 209 172 1441802 jit.matrix 4 char 1024 1024;
#P window setfont "Sans Serif" 9.;
#P window linecount 3;
#P comment 175 30 100 196617 bang to fill jit.matrixset with n pictures;
#P connect 17 0 6 0;
#P connect 16 0 6 0;
#P connect 14 0 8 0;
#P connect 15 0 8 0;
#P connect 8 0 12 0;
#P connect 1 0 8 0;
#P connect 4 0 8 0;
#P connect 6 0 8 0;
#P connect 10 2 9 0;
#P connect 13 0 10 1;
#P connect 11 0 10 0;
#P connect 9 1 3 0;
#P connect 3 1 2 0;
#P connect 9 0 1 0;
#P connect 2 0 1 0;
#P connect 9 2 5 0;
#P connect 5 0 4 0;
#P fasten 7 0 6 0 226 172 223 172;
#P window clipboard copycount 18;


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