Forums > Jitter

gldisable texture in sketch w/ jit.gl.texture

March 1, 2007 | 8:14 pm

this patch quickly demonstrates an inconsistency with the "gldisable texture" commnand in jit.gl.sketch. If i send a texture to jit.gl.render by prepending a jit_matrix message with "texture " then "gldisable texture" is respected. If I send a matrix to a jit.gl.texture, then the gldisable texture is ignored! maybe this can be sqeezed into 1.6.3? :)

Peter, (full of questions today!)

#P window setfont Arial 9.;
#P window linecount 1;
#P comment 45 444 165 131137545 pnyboer at slambassador dot com;
#P comment 39 23 165 131137545 0.) turn on rendering;
#P message 402 98 26 131137545 read;
#P window setfont Arial 10.;
#P window linecount 5;
#P comment 52 169 165 131137546 the texture "bun" is applied to the cylinder AND the sphere , which is unexpected , due to the command "gldisable texture" before the sphere is drawn;
#P button 34 129 15 0;
#P window linecount 3;
#P comment 52 130 165 131137546 2.) click here to enable "bun" texture and send different gl commands;
#P window linecount 5;
#P comment 53 60 165 131137546 the texture "this" is applied to the cylinder , but not the sphere , as expected , due to the command "gldisable texture" before the sphere is drawn;
#P button 34 48 15 0;
#P window setfont Arial 9.;
#P window linecount 1;
#P newex 329 56 47 131137545 loadbang;
#P user jit.pwindow 429 118 82 62 0 1 0 0 1 0;
#P newex 373 444 145 131137545 jit.window foo @depthbuffer 1;
#P message 256 138 45 131137545 drawto x;
#P message 251 159 53 131137545 drawto foo;
#P window linecount 2;
#P message 250 267 366 131137545 reset , glenable texture , glbindtexture bun , cylinder 1. 0.5 , glenable polygon_offset_fill , glpolygonoffset 1. -100. , glcolor 1 0 0 0 , gldisable texture , sphere 0.3 ,;
#P window linecount 1;
#P newex 97 364 73 131137545 r render_baby;
#P newex 292 399 51 131137545 r sketchy;
#P toggle 436 374 15 0;
#P message 436 397 94 131137545 smooth_shading $1;
#P toggle 535 374 15 0;
#P message 535 397 90 131137545 lighting_enable $1;
#P newex 38 331 43 131137545 jit.qball;
#P newex 399 346 50 131137545 loadbang;
#P number 83 282 35 9 0 0 0 2001 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 348 374 15 0;
#P message 348 397 81 131137545 depth_enable $1;
#P toggle 22 21 15 0;
#P newex 38 308 55 131137545 metro 20;
#P newex 38 362 47 131137545 t b erase;
#P newex 292 443 79 131137545 jit.gl.sketch foo;
#B color 5;
#P newex 58 384 80 131137545 jit.gl.render foo;
#P message 479 353 14 131137545 1;
#P newex 309 180 119 131137545 jit.gl.texture x @name bun;
#P newex 320 144 69 131137545 s render_baby;
#P newex 320 123 93 131137545 prepend texture this;
#P message 328 76 97 131137545 read dozer.mov , bang;
#P button 309 76 15 0;
#P newex 309 97 91 131137545 jit.qt.movie 320 240;
#P window linecount 2;
#P message 232 240 366 131137545 reset , glenable texture , glbindtexture this , cylinder 1. 0.5 , glenable polygon_offset_fill , glpolygonoffset 1. -100. , glcolor 1 0 0 0 , gldisable texture , sphere 0.3 ,;
#P window linecount 1;
#P newex 289 318 51 131137545 s sketchy;
#P window setfont Arial 10.;
#P comment 52 46 165 131137546 1.) click here to send gl commands;
#P fasten 14 0 13 0 27 178 43 178;
#P connect 13 0 19 0;
#P connect 19 0 12 0;
#P connect 12 0 10 0;
#P connect 12 1 10 0;
#P connect 25 0 10 0;
#P connect 17 0 13 1;
#P fasten 32 0 2 0 39 120 237 120;
#P fasten 35 0 26 0 39 266 255 266;
#P fasten 35 0 27 0 39 166 256 166;
#P fasten 26 0 1 0 255 297 294 297;
#P fasten 2 0 1 0 237 308 294 308;
#P connect 15 0 11 0;
#P connect 24 0 11 0;
#P connect 20 0 11 0;
#P connect 22 0 11 0;
#P fasten 5 0 3 0 333 95 314 95;
#P connect 4 0 3 0;
#P connect 37 0 3 0;
#P connect 3 0 8 0;
#P fasten 28 0 8 0 261 156 314 156;
#P fasten 27 0 8 0 256 176 314 176;
#P fasten 3 0 6 0 314 118 325 118;
#P connect 6 0 7 0;
#P connect 31 0 5 0;
#P fasten 9 0 16 0 484 371 353 371;
#P connect 16 0 15 0;
#P fasten 3 0 30 0 314 115 435 115;
#P fasten 9 0 23 0 484 371 441 371;
#P connect 23 0 22 0;
#P connect 18 0 9 0;
#P fasten 9 0 21 0 484 371 540 371;
#P connect 21 0 20 0;
#P window clipboard copycount 40;


March 1, 2007 | 8:31 pm

On Mar 1, 2007, at 12:14 PM, pnyboer wrote:

>
> this patch quickly demonstrates an inconsistency with the
> "gldisable texture" commnand in jit.gl.sketch. If i send a texture
> to jit.gl.render by prepending a jit_matrix message with "texture
> " then "gldisable texture" is respected. If I send a matrix
> to a jit.gl.texture, then the gldisable texture is ignored! maybe
> this can be sqeezed into 1.6.3? :)

FWIW, that’s because gldisable only deals with TEXTURE_2D at the
moment (vs. rectangular textures). What happens if you send the
message glbindexture with no texturename? That should disable the
texture target regardless of whether it’s a power or two or
rectangular texture target.

-Joshua


March 1, 2007 | 8:37 pm

that works!
thanks,
peter.


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