XML Feeds

.

[jitter] Bug report: jit.gl.slab not able to change context

MarkDavid Hosale markdavid at mdhosale.com
Sun Aug 12 19:30:33 MDT 2007


> I am also experience another problem that might be related. In a  
> patch I
> use three jit.gl.slab objects, two of them with @file  
> co.alphablend.jxs
> and the last one using a custom made slab.
>
> Sometimes when loading the patch and starting video processing, I  
> get a
> stream of these error messages:
>
> jit.gl.pbuffer: error binding texture: GL Error: Invalid operation
> • error: jit.gl.texture: unable to create texture!
>
> I of course assumed that this might be due to some problem with my
> custom slab, but testing yesterday revealed that sometimes when  
> loading
> the patch one of the jit.gl.slab @file co.alphablend.jxs objects would
> refuse to work. To solve the problem I would have to recreate it.
>
> I could post the patch, but it involves a Jamoma module and not only
> standard Max externals, so I won't do so unless someone asks for  
> it. Apart from the Jamoma module the patch is pretty straight-forward.

I have also noticed this problem, the problem may be related to  
custom made .jxs/GLSL files, but recall having had the problem with  
ready made shaders (can't reproduce here however). The problem also  
seems to be related to the number of slabs as well. I have one patch  
which is too complex to post, that uses approximately 45 textures. If  
load the patch just when max starts everything works fine. However,  
if I close the patch and reopen it (without quitting) I get the  error:

> jit.gl.pbuffer: error binding texture: GL Error: Invalid operation
> • error: jit.gl.texture: unable to create texture!

as reported above, with the added bonus that many things don't draw  
and the jit.gl.render object stops understanding the "erase"  
meassage. Restarting max solves the problem. But note that I have a  
similar patch using all of the same jxs/GLSL shader files, but with  
half of the shaders, and it doesn't behave the same way at all  
(opening and closing without max restart works fine).

When I have experienced similar problems in the past, I, on  
occasions, get the error below instead.

• error: jit.gl.texture: error attaching texture to readback  
mechanism for capture!
• error: jit.gl.pbuffer: error binding invalid pbuffer!

With the same circumstances, works first time, but not the second.

Although I am not sure the cause, with some experimenting I was able  
to reproduce with 3 slabs and a simple custom shader. To reproduce  
open the file on a fresh start of jitter. Start both metros (moving  
loading is optional). Close the patch, and without quitting, reopen  
the patch and start the metros again (again moving loading is  
optional). This produces errors every time. If I quit and restart max/ 
jitter, then the errors go away.
Files are below-
-hope this helps-
md

/////////////////////////////////////////////////////////////////
max v2;
#N vpatcher 401 44 1294 566;
#P origin 10 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 602 187 48 196617 loadbang;
#P message 590 292 33 196617 reset;
#P newex 570 267 32 196617 print;
#P message 529 187 67 196617 getparamlist;
#P message 535 132 65 196617 dim 720 480;
#P newex 553 325 79 196617 jit.gl.handle foo;
#P message 547 213 132 196617 read md.makeautoalpha.jxs;
#B color 14;
#P newex 510 350 185 196617 jit.gl.videoplane foo @scale 1.333 1. 1.;
#P message 573 97 28 196617 read;
#P message 638 97 27 196617 stop;
#P message 604 97 31 196617 start;
#P newex 510 157 104 196617 jit.qt.movie 320 240;
#P newex 510 244 70 196617 jit.gl.slab foo;
#B color 5;
#P newex 408 186 48 196617 loadbang;
#P message 396 291 33 196617 reset;
#P newex 376 266 32 196617 print;
#P message 335 186 67 196617 getparamlist;
#P message 341 131 65 196617 dim 720 480;
#P newex 359 324 79 196617 jit.gl.handle foo;
#P message 353 212 132 196617 read md.makeautoalpha.jxs;
#B color 14;
#P newex 316 349 185 196617 jit.gl.videoplane foo @scale 1.333 1. 1.;
#P message 379 96 28 196617 read;
#P message 444 96 27 196617 stop;
#P message 410 96 31 196617 start;
#P newex 316 156 104 196617 jit.qt.movie 320 240;
#P newex 316 243 70 196617 jit.gl.slab foo;
#B color 5;
#P newex 214 185 48 196617 loadbang;
#P message 202 290 33 196617 reset;
#P newex 182 265 32 196617 print;
#P message 141 185 67 196617 getparamlist;
#P message 147 130 65 196617 dim 720 480;
#P newex 165 323 79 196617 jit.gl.handle foo;
#P message 159 211 132 196617 read md.makeautoalpha.jxs;
#B color 14;
#P newex 122 348 185 196617 jit.gl.videoplane foo @scale 1.333 1. 1.;
#P message 185 95 28 196617 read;
#P message 250 95 27 196617 stop;
#P message 216 95 31 196617 start;
#P toggle 122 76 15 0;
#P newex 122 95 55 196617 metro 20;
#P newex 122 155 104 196617 jit.qt.movie 320 240;
#P comment 138 76 149 196617 • read a movie and start metro.;
#P newex 122 242 70 196617 jit.gl.slab foo;
#B color 5;
#P toggle 164 379 15 0;
#P message 164 397 45 196617 sync \$1;
#P toggle 91 379 15 0;
#P newex 52 378 35 196617 sel 27;
#P message 91 397 68 196617 fullscreen \$1;
#P newex 9 421 145 196617 jit.window foo @depthbuffer 1;
#P newex 7 378 40 196617 key;
#P user jit.fpsgui 34 302 60 196617 0;
#P number 57 110 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 12 110 15 0;
#P newex 12 136 55 196617 qmetro 20;
#P newex 12 251 55 196617 t b b erase;
#P newex 12 346 80 196617 jit.gl.render foo;
#P fasten 8 0 7 0 96 416 14 416;
#P fasten 11 0 7 0 169 416 14 416;
#P connect 3 0 2 0;
#P connect 2 0 1 0;
#P connect 1 0 0 0;
#P fasten 1 2 0 0 61 284 17 284;
#P connect 1 1 5 0;
#P fasten 6 0 9 0 12 397 49 397 49 376 57 376;
#P connect 4 0 2 1;
#P fasten 9 0 10 0 57 396 88 396 88 376 96 376;
#P connect 10 0 8 0;
#P connect 17 0 16 0;
#P fasten 16 0 15 0 127 122 127 122;
#P fasten 18 0 15 0 221 122 127 122;
#P fasten 19 0 15 0 255 122 127 122;
#P fasten 20 0 15 0 190 122 127 122;
#P connect 24 0 15 0;
#P connect 15 0 13 0;
#P fasten 22 0 13 0 164 234 127 234;
#P fasten 25 0 13 0 146 221 127 221;
#P fasten 23 0 21 0 170 344 127 344;
#P connect 13 0 21 0;
#P connect 28 0 22 0;
#P connect 12 0 11 0;
#P fasten 27 0 23 0 207 318 170 318;
#P connect 13 1 26 0;
#P fasten 16 0 30 0 127 123 321 123;
#P connect 37 0 30 0;
#P fasten 33 0 30 0 384 123 321 123;
#P fasten 32 0 30 0 449 123 321 123;
#P fasten 31 0 30 0 415 123 321 123;
#P fasten 38 0 29 0 340 222 321 222;
#P fasten 35 0 29 0 358 235 321 235;
#P connect 30 0 29 0;
#P connect 29 0 34 0;
#P fasten 36 0 34 0 364 345 321 345;
#P connect 41 0 35 0;
#P fasten 40 0 36 0 401 319 364 319;
#P connect 29 1 39 0;
#P fasten 16 0 43 0 127 123 515 123;
#P fasten 44 0 43 0 609 124 515 124;
#P fasten 45 0 43 0 643 124 515 124;
#P fasten 46 0 43 0 578 124 515 124;
#P connect 50 0 43 0;
#P connect 43 0 42 0;
#P fasten 48 0 42 0 552 236 515 236;
#P fasten 51 0 42 0 534 223 515 223;
#P fasten 49 0 47 0 558 346 515 346;
#P connect 42 0 47 0;
#P connect 54 0 48 0;
#P fasten 53 0 49 0 595 320 558 320;
#P connect 42 1 52 0;
#P pop;

/////////////////md.makeautoalpha.jxs///////////////////////////
<jittershader name="make alphamask">
	<description>
	Apply plane 1 of movie as an alpha mask
	</description>
	<param name="tex0" type="int" default="0" />
	<language name="glsl" version="1.0">
		<bind param="tex0" program="fp" />
		<program name="vp" type="vertex" source="sh.passthru.xform.vp.glsl" />
		<program name="fp" type="fragment">
<![CDATA[

// texcoords
varying vec2 texcoord0;


// samplers
uniform sampler2DRect tex0;



// entry point
void main()
{
	vec4 a = texture2DRect(tex0, texcoord0);

	gl_FragColor = vec4(a.rgb,a.r);
}

]]>
		</program>
	</language>
</jittershader>


///////////////////////////////////


More information about the jitter mailing list