jit.gl.mesh vs. jit.gl.videoplane: luminosity

Michele Verità's icon

hi all can someone please explain me what i'm missing here: why the movie rendered over jit.gl.mesh looks darker then the other two gl shapes..
thanks
michele

Max Patch
Copy patch and select New From Clipboard in Max.


Ben Bracken's icon

Michele,

You have the @lighting_enable attribute set to 1 in your jit.gl.mesh
object, which is making this "darker". You can control the various
lighting parameters in the jit.gl.render object.

all the best,
-Ben
mic wrote:
> hi all can someone please explain me what i'm missing here: why the movie rendered over jit.gl.mesh looks darker then the other two gl shapes..
> thanks
> michele
>
>
> max v2;
> #N vpatcher 333 98 1469 783;
> #P window setfont "Sans Serif" 9.;
> #P window linecount 1;
> #P newex 445 246 27 196617 + 1;
> #P user umenu 445 225 100 196647 1 64 241 1;
> #X add mesh;
> #X add gridshape;
> #X add videoplane;
> #P window linecount 5;
> #P newex 463 364 166 196617 jit.gl.gridshape foo @automatic 0 @texture tex1 @shape plane @scale 1.333 1. 1. @blend_enable 1 @color 1. 1. 1. 1.;
> #P window linecount 1;
> #P message 797 240 14 196617 1;
> #P message 201 277 17 196617 1.;
> #P newex 445 283 47 196617 gate 3 1;
> #P newex 295 124 143 196617 jit.gl.texture foo @name tex1;
> #B color 5;
> #P newex 243 24 45 196617 loadbang;
> #P button 243 180 15 0;
> #P newex 281 181 71 196617 prepend shape;
> #P user ubumenu 281 155 72 196617 0 1 1 0;
> #X add sphere;
> #X add torus;
> #X add cylinder;
> #X add opencylinder;
> #X add cube;
> #X add opencube;
> #X add plane;
> #X add circle;
> #X prefix_set 0 0 0;
> #X pattrmode 1;
> #P window linecount 5;
> #P newex 295 223 96 196617 jit.gl.gridshape @matrixoutput 1 @shape plane @blend_enable 1 @color 1. 1. 1. 1.;
> #P window linecount 1;
> #P newex 482 254 43 196617 r shape;
> #P newex 51 257 43 196617 s shape;
> #P flonum 797 261 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P message 797 282 82 196617 color 1. 1. 1. $1;
> #P flonum 201 298 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P message 201 319 82 196617 color 1. 1. 1. $1;
> #P newex 295 61 43 196617 r movie;
> #P newex 67 233 43 196617 s movie;
> #P message 66 449 85 196617 rect 0 0 640 480;
> #P message 342 61 80 196617 read dozer.mov;
> #P newex 295 96 104 196617 jit.qt.movie 320 240;
> #B color 5;
> #P toggle 245 470 15 0;
> #P message 245 488 55 196617 floating $1;
> #P toggle 172 470 15 0;
> #P newex 133 469 35 196617 sel 27;
> #P message 172 488 68 196617 fullscreen $1;
> #P newex 90 512 145 196617 jit.window foo @depthbuffer 1;
> #P newex 88 469 40 196617 key;
> #P user jit.fpsgui 35 297 60 196617 0;
> #P newex 19 172 43 196617 jit.qball;
> #P number 64 123 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P toggle 19 123 15 0;
> #P newex 19 149 55 196617 metro 20;
> #P newex 19 203 74 196617 t b b b b erase;
> #P window linecount 8;
> #P newex 295 354 111 196617 jit.gl.mesh foo @automatic 0 @depth_enable 0 @blend_enable 1 @scale 1.333 1. 1. @texture tex1 @lighting_enable 1 @smooth_shading 1;
> #B color 5;
> #P window linecount 1;
> #P newex 19 603 239 196617 jit.gl.render foo @ortho 2 @erase_color 0. 0. 0. 1.;
> #P window linecount 5;
> #P newex 723 327 124 196617 jit.gl.videoplane foo @automatic 0 @depth_enable 0 @blend_enable 1 @scale 1.333 1. 1.;
> #B color 5;
> #P window linecount 2;
> #P comment 405 187 118 196617 switch between gl.mesh and gl.videoplane;
> #P connect 6 0 5 0;
> #P connect 5 0 8 0;
> #P connect 8 0 4 0;
> #P connect 4 0 2 0;
> #P fasten 4 4 2 0 88 227 24 227;
> #P connect 4 1 9 0;
> #P connect 4 2 26 0;
> #P connect 7 0 5 1;
> #P connect 4 3 20 0;
> #P fasten 12 0 11 0 177 507 95 507;
> #P fasten 15 0 11 0 250 507 95 507;
> #P fasten 19 0 11 0 71 497 95 497;
> #P fasten 10 0 13 0 93 488 130 488 130 467 138 467;
> #P fasten 13 0 14 0 138 487 169 487 169 467 177 467;
> #P connect 14 0 12 0;
> #P connect 32 0 35 0;
> #P connect 35 0 23 0;
> #P connect 23 0 22 0;
> #P connect 32 0 31 0;
> #P connect 16 0 15 0;
> #P fasten 29 1 30 0 317 176 286 176;
> #P fasten 18 0 17 0 347 87 300 87;
> #P connect 21 0 17 0;
> #P connect 17 0 33 0;
> #P fasten 30 0 28 0 286 203 300 203;
> #P fasten 31 0 28 0 248 208 300 208;
> #P fasten 34 0 3 0 450 327 300 327;
> #P connect 28 0 3 0;
> #P fasten 22 0 3 0 206 344 300 344;
> #P connect 32 0 18 0;
> #P connect 38 0 39 0;
> #P connect 39 0 34 0;
> #P connect 34 1 37 0;
> #P connect 27 0 34 1;
> #P connect 34 2 1 0;
> #P fasten 17 0 1 0 300 118 728 118;
> #P fasten 24 0 1 0 802 311 728 311;
> #P fasten 32 0 36 0 248 148 802 148;
> #P connect 36 0 25 0;
> #P connect 25 0 24 0;
> #P pop;
>
>

--
Cycling '74
https://cycling74.com

Main Office *note new address*:
730 Clementina Street
San Francisco, CA 94103 USA
p: 415-974-1818
f: 415-974-1812

Authorization Support:
p: 415-974-1818 ext. 2#
e: challenge@cycling74.com

Technical Support:
p: 415-974-1818 ext. 5#
e: support@cycling74.com

Michele Verità's icon

hi Ben,
thanks for your quick response..yes lighting_enable is 1 to use color message, otherwise i can't adjust alpha of the plane... :(

vade's icon

default color is 0.5 0.5 0.5 1.

send color 1. 1. 1. 1. to the other objects (im guessing since I
havent run the patch, but I ran into this myself)

On Jul 19, 2007, at 5:05 PM, mic wrote:

>
> hi Ben,
> thanks for your quick response..yes lighting_enable is 1 to use
> color message, otherwise i can't adjust alpha of the plane... :(

v a d e //

www.vade.info
abstrakt.vade.info

Michele Verità's icon

sorry vade i can't get it..i already use the message color 1. 1. 1. $1 to control the transparency of the shape used, whith gridshape and videoplane noproblem, i have problems with gl.mesh that is darker even if color 1. 1. 1. 1. and if i disable lighting i can't control color anymore..

Andrew Benson's icon

I think you are looking for blend_enable, not lighting_enable.

Best,
AB

Andrew Benson's icon

After looking at this a little more, it appears that the color info from
the gridshape is getting sent on to the jit.gl.mesh via the
matrixoutput. To verify this, try changing the color of the
jit.gl.gridshape object. I'm not sure why the behavior is different
when lighting_enable is turned on, but you can eliminate this issue by
ditching the color planes of the jit.gl.gridshape matrix. You can
easily do this by inserting a jit.unpack @jump 8 object. This will pass
the vertices, texcoords, and normals.

Best,
Andrew B.

Wesley Smith's icon

It's different because buffers of color data have no effect when
lighting_enable is on. the color attribute works however because it
is _faked_ under the food. i.e. it's not actually setting the
glColor() setting but stuff like glMaterial(GL_AMBIENT, ...) etc.
This is what people want in most cases but completely breaks down for
buffers where setting material attributes isn't possible. To get it
to work with light enabled turn the color buffer into a texture.

wes

On 7/20/07, andrew benson wrote:
> After looking at this a little more, it appears that the color info from
> the gridshape is getting sent on to the jit.gl.mesh via the
> matrixoutput. To verify this, try changing the color of the
> jit.gl.gridshape object. I'm not sure why the behavior is different
> when lighting_enable is turned on, but you can eliminate this issue by
> ditching the color planes of the jit.gl.gridshape matrix. You can
> easily do this by inserting a jit.unpack @jump 8 object. This will pass
> the vertices, texcoords, and normals.
>
> Best,
> Andrew B.
>

Wesley Smith's icon

that should be faked under the hood not food.

wes

On 7/20/07, Wesley Smith wrote:
> It's different because buffers of color data have no effect when
> lighting_enable is on. the color attribute works however because it
> is _faked_ under the food. i.e. it's not actually setting the
> glColor() setting but stuff like glMaterial(GL_AMBIENT, ...) etc.
> This is what people want in most cases but completely breaks down for
> buffers where setting material attributes isn't possible. To get it
> to work with light enabled turn the color buffer into a texture.
>
> wes
>
> On 7/20/07, andrew benson wrote:
> > After looking at this a little more, it appears that the color info from
> > the gridshape is getting sent on to the jit.gl.mesh via the
> > matrixoutput. To verify this, try changing the color of the
> > jit.gl.gridshape object. I'm not sure why the behavior is different
> > when lighting_enable is turned on, but you can eliminate this issue by
> > ditching the color planes of the jit.gl.gridshape matrix. You can
> > easily do this by inserting a jit.unpack @jump 8 object. This will pass
> > the vertices, texcoords, and normals.
> >
> > Best,
> > Andrew B.
> >
>

pelado's icon

if you are content not to use lighting effects you can change the @apply attribute of the texture to decal, this will let you use the alpha value of the colour in mesh to fade in and out.

pelado

Karl Kliem's icon

i have a strange problem, as i use jit.lcd in the example, i post it
over here, although it's probably a max problem.

if i trigger the button with the mouse, the number is displayed in
the jit.pwindow as expected. when i use a midi input to trigger the
same button, the random number is shown in the numberbox, but nothing
is shown in the jit.pwindow. i had this problem ocationally in other
situations. any idea?

macbook pro, rev a, max msp 4.6.3, jitter 1.6.3, midiman midisport 2x2

k.

Max Patch
Copy patch and select New From Clipboard in Max.


nesa's icon

Hello mister!

you'll have to use a bit of max cabala when playing with threads:

try inserting jit.qball after ctlin...

hth,
nesa

On Jul 20, 2007, at 7:57 PM, Karl Kliem wrote:

> i have a strange problem, as i use jit.lcd in the example, i post
> it over here, although it's probably a max problem.
>
>
> if i trigger the button with the mouse, the number is displayed in
> the jit.pwindow as expected. when i use a midi input to trigger the
> same button, the random number is shown in the numberbox, but
> nothing is shown in the jit.pwindow. i had this problem ocationally
> in other situations. any idea?
>
> macbook pro, rev a, max msp 4.6.3, jitter 1.6.3, midiman midisport 2x2
>
>
> k.
>
>
> max v2;
> #N vpatcher 222 172 902 663;
> #P window setfont "Sans Serif" 9.;
> #P message 344 257 67 196617 moveto 4 44;
> #P window linecount 2;
> #P comment 219 57 405 196617
> triggering the bang and the numberox also shows the random number
> , but no number is shown in jit.pwindow;
> #P user jit.pwindow 159 337 42 50 0 1 0 0 1 0;
> #P window linecount 1;
> #P message 46 231 77 196617 font geneva 48;
> #P button 160 132 15 0;
> #P newex 160 105 38 196617 sel 68;
> #P number 160 81 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 160 55 40 196617 ctlin;
> #P newex 160 309 99 196617 jit.lcd 4 char 40 48;
> #B color 5;
> #P newex 160 233 197 196617 t b b b l b;
> #P message 206 257 29 196617 clear;
> #P newex 160 257 44 196617 del 100;
> #P newex 160 209 69 196617 prepend write;
> #P newex 160 164 52 196617 random 9;
> #P number 160 187 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P message 46 266 39 196617 color 0;
> #P newex 21 206 45 196617 loadbang;
> #P message 46 249 62 196617 brgb 0 0 0 0;
> #P comment 187 133 326 196617
> number in jit.pwindow (as expected);
> #P connect 2 0 15 0;
> #P connect 2 0 1 0;
> #P connect 2 0 3 0;
> #P connect 11 0 12 0;
> #P connect 12 0 13 0;
> #P connect 13 0 14 0;
> #P connect 14 0 5 0;
> #P connect 5 0 4 0;
> #P connect 4 0 6 0;
> #P connect 6 0 9 0;
> #P connect 9 0 7 0;
> #P connect 9 3 10 0;
> #P connect 9 2 10 0;
> #P connect 18 0 10 0;
> #P connect 15 0 10 0;
> #P connect 3 0 10 0;
> #P connect 1 0 10 0;
> #P connect 7 0 10 0;
> #P connect 8 0 10 0;
> #P connect 10 0 16 0;
> #P connect 9 1 8 0;
> #P connect 9 4 18 0;
> #P pop;
>

Karl Kliem's icon

hi nesa,

thanks for the quick reply. it works!

lg,
karl

On 20.07.2007, at 21:00, nesa wrote:

> Hello mister!
>
> you'll have to use a bit of max cabala when playing with threads:
>
> try inserting jit.qball after ctlin...
>
> hth,
> nesa
>
> On Jul 20, 2007, at 7:57 PM, Karl Kliem wrote:
>
>> i have a strange problem, as i use jit.lcd in the example, i post
>> it over here, although it's probably a max problem.
>>
>>
>> if i trigger the button with the mouse, the number is displayed in
>> the jit.pwindow as expected. when i use a midi input to trigger
>> the same button, the random number is shown in the numberbox, but
>> nothing is shown in the jit.pwindow. i had this problem
>> ocationally in other situations. any idea?
>>
>> macbook pro, rev a, max msp 4.6.3, jitter 1.6.3, midiman midisport
>> 2x2
>>
>>
>> k.
>>
>>
>> max v2;
>> #N vpatcher 222 172 902 663;
>> #P window setfont "Sans Serif" 9.;
>> #P message 344 257 67 196617 moveto 4 44;
>> #P window linecount 2;
>> #P comment 219 57 405 196617
>> triggering the bang and the numberox also shows the random number
>> , but no number is shown in jit.pwindow;
>> #P user jit.pwindow 159 337 42 50 0 1 0 0 1 0;
>> #P window linecount 1;
>> #P message 46 231 77 196617 font geneva 48;
>> #P button 160 132 15 0;
>> #P newex 160 105 38 196617 sel 68;
>> #P number 160 81 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
>> #P newex 160 55 40 196617 ctlin;
>> #P newex 160 309 99 196617 jit.lcd 4 char 40 48;
>> #B color 5;
>> #P newex 160 233 197 196617 t b b b l b;
>> #P message 206 257 29 196617 clear;
>> #P newex 160 257 44 196617 del 100;
>> #P newex 160 209 69 196617 prepend write;
>> #P newex 160 164 52 196617 random 9;
>> #P number 160 187 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
>> #P message 46 266 39 196617 color 0;
>> #P newex 21 206 45 196617 loadbang;
>> #P message 46 249 62 196617 brgb 0 0 0 0;
>> #P comment 187 133 326 196617
>> number in jit.pwindow (as expected);
>> #P connect 2 0 15 0;
>> #P connect 2 0 1 0;
>> #P connect 2 0 3 0;
>> #P connect 11 0 12 0;
>> #P connect 12 0 13 0;
>> #P connect 13 0 14 0;
>> #P connect 14 0 5 0;
>> #P connect 5 0 4 0;
>> #P connect 4 0 6 0;
>> #P connect 6 0 9 0;
>> #P connect 9 0 7 0;
>> #P connect 9 3 10 0;
>> #P connect 9 2 10 0;
>> #P connect 18 0 10 0;
>> #P connect 15 0 10 0;
>> #P connect 3 0 10 0;
>> #P connect 1 0 10 0;
>> #P connect 7 0 10 0;
>> #P connect 8 0 10 0;
>> #P connect 10 0 16 0;
>> #P connect 9 1 8 0;
>> #P connect 9 4 18 0;
>> #P pop;
>>
>