Jitter 1.6 a few Issues with imageunits – dims – memory leak? ?

Jun 25, 2006 at 3:44am

Jitter 1.6 a few Issues with imageunits – dims – memory leak? ?

Mixing textures of different dims through a jit.gl.imageunit (with an
image unit loaded that uses two inputs) results in the smaller dimed
texture *not* being scaled to the output dim of the 1st texture. This
results in a ‘picture in picture’ effect. This happens regardless of
colormode.

Hardware/Software – Mac OS X 10.4.6 – Powerbook G4 1.6.7 128Mb VRam
Max 4.6 public beta Jitter 1.6 public beta

Expected behavior: Well, Im uncertain how this should work. IMO
ideally the texture dims would be matched to the leftmode inlets
texture dims. But is this something we will have to manage ourselves?
the MOP object does this for matrices in jitter land, so id expect
something equivalent.

Also, I have been able to reproduce a memory leak by changing the
size of the window when working with jit.gl.imageunit – it seemed to
happen more with @colormode uyvy, but I could get it to do it in argb
mode. I havent figured out what exactly causes it, but watching top
with the patch open I notice a memory increase.

here is the bug patch :

max v2;
#N vpatcher 46 158 950 850;
#P origin 0 30;
#P window setfont “Sans Serif” 9.;
#P message 90 57 82 196617 colormode uyvy;
#P message 90 74 79 196617 colormode argb;
#P user jit.fpsgui 15 203 60 196617 0;
#P message 474 80 30 196617 read;
#P message 243 81 30 196617 read;
#P toggle 15 21 15 0;
#P newex 15 48 51 196617 qmetro 2;
#P newex 243 579 289 196617 jit.gl.videoplane bug1 @scale 1.33333 1.
1. @colormode uyvy;
#P newex 286 476 55 196617 delay 100;
#P newex 286 502 74 196617 t getparamlist;
#P flonum 763 315 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 726 315 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 688 315 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 650 315 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 608 335 15 0;
#P newex 608 357 118 196617 pack param 0 0. 0. 0. 0.;
#P user ubumenu 629 294 166 196617 0 1 1 0;
#X add “Red Vector”;
#X add “Green Vector”;
#X add “Blue Vector”;
#X add “Alpha Vector”;
#X add “Bias Vector”;
#X prefix_set 0 0 0;
#X pattrmode 1;
#P newex 432 310 25 196617 iter;
#P newex 432 332 75 196617 prepend append;
#P newex 432 287 92 196617 t l clear;
#P newex 286 311 25 196617 iter;
#P newex 477 502 90 196617 prepend getparam;
#P user ubumenu 461 381 138 196617 0 1 1 0;
#X add “Red Vector”;
#X add “Green Vector”;
#X add “Blue Vector”;
#X add “Alpha Vector”;
#X add “Bias Vector”;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 379 502 92 196617 prepend loadeffect;
#P newex 286 333 75 196617 prepend append;
#P user ubumenu 286 370 142 196617 0 1 1 0;
#X add Addition;
#X add “Affine Clamp”;
#X add “Affine Tile”;
#X add “Affine Transform”;
#X add “Blend With Mask”;
#X add Bloom;
#X add “Bump Distortion”;
#X add Checkerboard;
#X add “Circle Splash Distortion”;
#X add “Circular Screen”;
#X add “Circular Wrap Distortion”;
#X add “CMYK Halftone”;
#X add “Color Blend Mode”;
#X add “Color Burn Blend Mode”;
#X add “Color Controls”;
#X add “Color Cube”;
#X add “Color Dodge Blend Mode”;
#X add “Color Invert”;
#X add “Color Map”;
#X add “Color Matrix”;
#X add “Color Monochrome”;
#X add “Color Posterize”;
#X add “Constant Color”;
#X add “Copy Machine”;
#X add Crop;
#X add Crystallize;
#X add “Darken Blend Mode”;
#X add “Difference Blend Mode”;
#X add “Disintegrate with Mask”;
#X add “Displacement Distortion”;
#X add Dissolve;
#X add “Dot Screen”;
#X add Edges;
#X add “Edge Work”;
#X add “Exclusion Blend Mode”;
#X add “Exposure Adjust”;
#X add “False Color”;
#X add Flash;
#X add “Gamma Adjust”;
#X add “Gaussian Blur”;
#X add “Gaussian Gradient”;
#X add “Glass Distortion”;
#X add “Glass Lozenge”;
#X add Gloom;
#X add “Hard Light Blend Mode”;
#X add “Hatched Screen”;
#X add “Height Field From Mask”;
#X add “Hole Distortion”;
#X add “Hue Adjust”;
#X add “Hue Blend Mode”;
#X add Kaleidoscope;
#X add “Lanczos Scale Transform”;
#X add “Lenticular Halo”;
#X add “Lighten Blend Mode”;
#X add “Linear Gradient”;
#X add “Line Screen”;
#X add “Luminosity Blend Mode”;
#X add “Mask To Alpha”;
#X add Maximum;
#X add Median;
#X add Minimum;
#X add Mod;
#X add “Motion Blur”;
#X add “Multiply Blend Mode”;
#X add Multiply;
#X add “Noise Reduction”;
#X add “Op Tile”;
#X add “Overlay Blend Mode”;
#X add “Page Curl”;
#X add “Parallelogram Tile”;
#X add “Perspective Tile”;
#X add “Perspective Transform”;
#X add “Pinch Distortion”;
#X add Pixellate;
#X add Pointillize;
#X add “Radial Gradient”;
#X add “Random Generator”;
#X add Ripple;
#X add “Saturation Blend Mode”;
#X add “Screen Blend Mode”;
#X add “Sepia Tone”;
#X add “Shaded Material”;
#X add “Sharpen Luminance”;
#X add “Soft Light Blend Mode”;
#X add “Source Atop”;
#X add “Source In”;
#X add “Source Out”;
#X add “Source Over”;
#X add “Spot Light”;
#X add “Star Shine”;
#X add Stripes;
#X add Sunbeams;
#X add Swipe;
#X add “Torus Lens Distortion”;
#X add “Triangle Tile”;
#X add “Twirl Distortion”;
#X add “Unsharp Mask”;
#X add “Vortex Distortion”;
#X add “White Point Adjust”;
#X add “Zoom Blur”;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 286 288 92 196617 t l clear;
#P newex 286 265 303 196617 route effectlist paramlist;
#P newex 544 292 31 196617 print;
#P newex 243 226 241 196617 jit.gl.imageunit bug1 @colormode uyvy
@verbose 1;
#P window linecount 2;
#P comment 174 510 58 196617 temporary: need to fix;
#P window linecount 1;
#P newex 474 167 188 196617 jit.qt.movie 160 120 @colormode uyvy;
#P newex 243 167 188 196617 jit.qt.movie 320 240 @colormode uyvy;
#P newex 15 75 58 196617 t b b erase;
#P newex 15 169 89 196617 jit.gl.render bug1;
#P newex 15 263 82 196617 jit.window bug1;
#P comment 24 371 256 196617 Bug – > select a blend mode unit “like
blend with mask”;
#P connect 31 0 30 0;
#P connect 30 0 3 0;
#P connect 3 2 2 0;
#P connect 3 0 2 0;
#P connect 2 0 34 0;
#P fasten 36 0 4 0 95 120 248 120;
#P fasten 35 0 4 0 95 108 248 108;
#P fasten 3 1 4 0 44 120 248 120;
#P connect 32 0 4 0;
#P connect 36 0 7 0;
#P connect 35 0 7 0;
#P fasten 27 0 7 0 291 533 231 533 231 211 248 211;
#P fasten 13 0 7 0 384 533 231 533 231 211 248 211;
#P fasten 21 0 7 0 613 533 231 533 231 211 248 211;
#P fasten 15 0 7 0 482 533 231 533 231 211 248 211;
#P connect 4 0 7 0;
#P connect 36 0 29 0;
#P connect 35 0 29 0;
#P connect 7 0 29 0;
#P fasten 7 1 9 0 479 247 291 247;
#P connect 9 0 10 0;
#P connect 10 0 16 0;
#P connect 16 0 12 0;
#P connect 12 0 11 0;
#P fasten 10 1 11 0 373 356 291 356;
#P connect 11 0 28 0;
#P connect 28 0 27 0;
#P fasten 11 1 13 0 357 400 384 400;
#P connect 9 1 17 0;
#P connect 17 0 19 0;
#P connect 19 0 18 0;
#P fasten 18 0 14 0 437 370 466 370;
#P fasten 17 1 14 0 519 355 466 355;
#P fasten 36 0 5 0 95 108 479 108;
#P fasten 35 0 5 0 95 108 479 108;
#P fasten 3 1 5 0 44 108 479 108;
#P connect 33 0 5 0;
#P connect 5 0 7 1;
#P fasten 14 0 15 0 466 486 482 486;
#P fasten 9 2 8 0 583 287 549 287;
#P fasten 26 0 22 0 768 332 613 332;
#P fasten 25 0 22 0 731 332 613 332;
#P fasten 24 0 22 0 693 332 613 332;
#P fasten 23 0 22 0 655 332 613 332;
#P connect 22 0 21 0;
#P fasten 18 0 20 0 437 361 603 361 603 279 634 279;
#P fasten 17 1 20 0 519 329 603 329 603 279 634 279;
#P connect 20 0 21 1;
#P fasten 23 0 21 2 655 343 655 343;
#P fasten 24 0 21 3 693 343 676 343;
#P fasten 25 0 21 4 731 345 697 345;
#P fasten 26 0 21 5 768 350 718 350;
#P pop;

Bug 2 patch

v a d e //

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

#26547
Jul 28, 2006 at 9:21pm

On Jun 24, 2006, at 8:44 PM, vade wrote:
>
> Mixing textures of different dims through a jit.gl.imageunit (with
> an image unit loaded that uses two inputs) results in the smaller
> dimed texture *not* being scaled to the output dim of the 1st
> texture. This results in a ‘picture in picture’ effect. This
> happens regardless of colormode.

Sorry, but this behavior won’t change and is the way imageunits work
with different sized inputs. And for some kinds of additional image
inputs (like gradient image inputs), you explicitly don’t want to
upsample to the lefthand texture size. So yse, this is something
you’ll need to manage yourselves, but you can do so without much
dificulty.

Just use an instance of jit.gl.slab @adapt 0 @dim ,
before the righthand input to jit.gl.imageunit. You can also avoid
the green border problems visible with UYVY textures and certain
image units which extend black (uyvy green) for regions outside the
image, but using jit.gl.slab before jit.gl.imageunit to always
convert the uyvy data to argb data before the imageunit. Again this
is something you’ll need to manage yourself. This incurs a slight
performance penalty, so we won’t force it to happen for all cases. We
might figure out a solution to this in the future, but this is the
behavior Jitter 1.6 will ship with.

-Joshua

#79557

You must be logged in to reply to this topic.