problem with jit.gl.texture and jit.gl.gridshape

Feb 20, 2007 at 11:57am

problem with jit.gl.texture and jit.gl.gridshape

i seemingly have been very little luck getting this object to work for me!

i have a texture in jit.gl.texture assigned to jit.gridshape… it works as expected with blend_enable switched off, but as soon as i switch it on the object disappears?

maybe i’m missing something obvious?

any help appreciated, patch below.

[system info]
mbp 2.16ghz / 1gb ram
osx.4.8 + recent updates
maxmsp 4.6.2 +incremental updates / jitter 1.6b2

justin

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 89 332 82 196617 prepend texture;
#P user ubumenu 44 307 100 196617 0 1 1 0;
#X add none;
#X add grad1;
#X prefix_set 0 0 0;
#P newex 560 29 66 196617 loadmess 20;
#P message 381 332 90 196617 rebuild_geometry;
#P newex 48 131 104 196617 jit.qball @mode usurp;
#P window setfont “Sans Serif” 18.;
#P comment 77 54 67 196626 render;
#P window setfont “Sans Serif” 9.;
#P newex 48 227 234 196617 jit.window texturtest @floating 1 @depthbuffer 1;
#P toggle 48 53 28 0;
#P newex 48 95 52 196617 metro 20;
#P newex 48 168 58 196617 t b erase b;
#P window linecount 2;
#P newex 48 195 270 196617 jit.gl.render texturtest @depth_enable 1 @blend_enable 1 @blend_mode 6 7 @smooth_shading 0 @lighting_enable 0;
#P toggle 295 314 15 0;
#P window linecount 1;
#P message 295 332 82 196617 blend_enable $1;
#P toggle 241 314 15 0;
#P message 241 332 53 196617 enable $1;
#P newex 534 194 115 196617 jit.brcosa @contrast 1.;
#P number 560 61 35 9 20 128 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 691 136 56 196617 dim $1 $1;
#P number 172 314 35 9 0 3 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 172 332 64 196617 tex_map $1;
#P window linecount 2;
#P newex 112 367 342 196617 jit.gl.gridshape texturtest @antialias 1 @shape plane @scale 0.5 0.25 0.5 @blend_enable 0 @blend_mode 6 1 @color 1. 1. 1. 0.5 @texture grad1;
#P window linecount 1;
#P newex 534 253 240 196617 jit.gl.texture texturtest @name grad1 @filter none;
#P newex 519 111 40 196617 t b b b;
#P newex 534 214 175 196617 jit.rota @zoom_x 0.5 @boundmode 4;
#P button 519 83 15 0;
#P user jit.pwindow 497 273 130 130 0 0 0 0 1 0;
#P message 617 136 73 196617 end 0. 0. 0. 0.;
#P message 534 136 81 196617 start 0. 1. 1. 1.;
#P newex 534 174 135 196617 jit.gradient 4 char 128 128;
#P window linecount 2;
#P comment 73 258 365 196617 whenever blend_enable is switched on , the object disappears from the screen? without any texture loaded the blend_enable works as expected…;
#P fasten 13 0 5 0 565 79 524 79;
#P fasten 13 0 12 0 565 106 696 106;
#P fasten 7 2 3 0 554 132 622 132;
#P connect 27 0 13 0;
#P fasten 6 0 4 0 539 244 503 244;
#P connect 6 0 8 0;
#P connect 14 0 6 0;
#P connect 1 0 14 0;
#P fasten 12 0 1 0 696 162 539 162;
#P fasten 3 0 1 0 622 162 539 162;
#P connect 2 0 1 0;
#P connect 7 0 1 0;
#P connect 7 1 2 0;
#P connect 5 0 7 0;
#P connect 18 0 17 0;
#P connect 16 0 15 0;
#P connect 11 0 10 0;
#P fasten 17 0 9 0 300 359 117 359;
#P fasten 15 0 9 0 246 359 117 359;
#P fasten 10 0 9 0 177 359 117 359;
#P fasten 26 0 9 0 386 359 117 359;
#P connect 29 0 9 0;
#P connect 28 1 29 0;
#P connect 20 1 19 0;
#P connect 20 0 19 0;
#P connect 25 0 20 0;
#P connect 21 0 25 0;
#P fasten 22 0 21 0 53 82 53 82;
#P window clipboard copycount 30;

#30367
Feb 20, 2007 at 3:11pm

Quote: justin wrote on Tue, 20 February 2007 12:57
—————————————————-
> i seemingly have been very little luck getting this object to work for me!
>
> i have a texture in jit.gl.texture assigned to jit.gridshape… it works as expected with blend_enable switched off, but as soon as i switch it on the object disappears?
>
> maybe i’m missing something obvious?
Yes you are ;-) Your gradient goes from 0. 0. 0. 0. to 0. 1. 1. 1., so when you turn on the blend your alpha channel kicks in at 0., no matter what.

If you want a “blend gradient” I guess a 0. 0. 0. 0. to 1. 0. 0. 0. gradient is what you should do?

(caveat: I could be wrong too ;) )
Cheers,
Andreas.

#96948
Feb 20, 2007 at 3:40pm

oops thanks for pointing that one out : )

forgot about the alpha layer within the rgb values!

cheers.

#96949

You must be logged in to reply to this topic.