[PD] GEM question - glsl and shared context

oliver oliver at klingt.org
Sat Jun 10 22:09:25 CEST 2017


hi, dear list !

attached is an example patch that should demonstrate my question ...


as far as i understood, once a texture is "made" (i.e. from a 
[pix_image]) it can be shared by other render chains by connecting its 
right outlet to another texture's right inlet (the whole list has to be 
provided)

while this works in a simple setup, i tried the same with a glsl effect 
in between. this one didn't work as expected, as the shared texture was 
the original one (BEFORE the shading effect)

how would i distribute the texture AFTER the shading program ?

thanks in advance !





a more general question:

finding tutorials or "manuals" about GEM (especially about openGL, 
textures and glsl stuff) is quite confusing and frustrating at times, so 
the learning curve for a noob like me is quite steep. simple setups as 
described in the example patches work alright, but once i try to adapt 
them to slightly different scenarios i usually end up completely blank.

for example:
what is the "texunit" message as opposed to the texture id ?

anyway, i just wanted to ask the list if there are some sort of 
"tutorial" or "lessons" stuff concerning GEM ?

so far i found these the most useful and elaborate:

https://github.com/extendedview/extended_view_toolkit (best one !)
https://github.com/b01xy/glsl
http://grh.mur.at/blog/pd-workshop-joanneum

but something a little more "basic" or "systematic" would be great !


still, GEM is enigmatic but great, i can only guess its complete powers, 
will keep hanging on !

best

oliver


-------------- next part --------------
#N canvas 591 50 601 691 10;
#X obj 36 82 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 1
;
#X obj 36 102 gemhead 10;
#X obj 279 82 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1
1;
#X obj 279 102 gemhead 12;
#X obj 279 174 pix_texture;
#X obj 428 219 gemwin;
#X msg 448 197 destroy \, 0;
#X obj 429 138 sel 1 0;
#X obj 429 104 tgl 25 0 empty empty empty 17 7 0 10 -262144 -1 -1 1
1;
#X obj 429 29 loadbang;
#X obj 429 52 del 100;
#X msg 429 76 1;
#X obj 36 124 pix_image Gem/examples/10.glsl/img1.jpg;
#X obj 36 145 pix_texture;
#X obj 138 52 tgl 30 0 empty empty empty 17 7 0 10 -262144 -1 -1 1
1;
#X msg 428 160 reset \, dimen 320 320 \, offset 10 550 \, create \,
1, f 25;
#X obj 37 307 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 370 307 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 370 399 pix_texture;
#X obj 37 608 pix_texture;
#X obj 119 277 tgl 30 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 37 329 gemhead 20;
#X obj 370 327 gemhead 22;
#X obj 37 442 glsl_vertex;
#X obj 37 534 glsl_program;
#X obj 126 510 pack 0 0;
#X obj 126 466 change;
#X obj 112 441 change;
#X msg 126 534 link \$1 \$2;
#X obj 37 466 glsl_fragment;
#X floatatom 126 490 2 0 0 0 ID - -, f 2;
#X floatatom 172 442 2 0 0 0 ID - -, f 2;
#X msg 47 398 open Gem/examples/10.glsl/texture.vert;
#X msg 47 418 open Gem/examples/10.glsl/texture.frag;
#X obj 37 349 pix_image Gem/examples/10.glsl/img1.jpg;
#X msg 206 473 C -2;
#X obj 36 205 square 2;
#X obj 36 177 translateXYZ 1.5 0 0;
#X obj 279 218 square 1.5;
#X obj 279 196 translateXYZ -2.2 0 0;
#X obj 47 376 loadbang;
#X obj 106 557 t b;
#X obj 106 580 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X obj 119 235 loadbang;
#X msg 119 256 0;
#X obj 138 10 loadbang;
#X msg 138 31 1;
#X obj 370 443 square 1.5;
#X obj 370 421 translateXYZ -2.2 0 0;
#X obj 37 653 square 2;
#X obj 37 629 translateXYZ 1.5 0 0;
#X text 124 606 <--- why is this the texture BEFORE the shading effect
?;
#X text 381 350 how would i put the texture AFTER the shader here ?
, f 19;
#X text 179 56 this works as expected;
#X text 161 282 this doesn't;
#X connect 0 0 1 0;
#X connect 1 0 12 0;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 4 0 39 0;
#X connect 6 0 5 0;
#X connect 7 0 15 0;
#X connect 7 1 6 0;
#X connect 8 0 7 0;
#X connect 9 0 10 0;
#X connect 10 0 11 0;
#X connect 11 0 8 0;
#X connect 12 0 13 0;
#X connect 13 0 37 0;
#X connect 13 1 4 1;
#X connect 14 0 0 0;
#X connect 14 0 2 0;
#X connect 15 0 5 0;
#X connect 16 0 21 0;
#X connect 17 0 22 0;
#X connect 18 0 48 0;
#X connect 19 0 50 0;
#X connect 19 1 18 1;
#X connect 20 0 16 0;
#X connect 20 0 17 0;
#X connect 21 0 34 0;
#X connect 22 0 18 0;
#X connect 23 0 29 0;
#X connect 23 1 27 0;
#X connect 24 0 19 0;
#X connect 24 1 41 0;
#X connect 25 0 28 0;
#X connect 26 0 30 0;
#X connect 27 0 31 0;
#X connect 28 0 24 0;
#X connect 29 0 24 0;
#X connect 29 1 26 0;
#X connect 30 0 25 0;
#X connect 31 0 25 1;
#X connect 32 0 23 0;
#X connect 33 0 29 0;
#X connect 34 0 23 0;
#X connect 35 0 24 0;
#X connect 37 0 36 0;
#X connect 39 0 38 0;
#X connect 40 0 32 0;
#X connect 40 0 33 0;
#X connect 41 0 35 0;
#X connect 41 0 42 0;
#X connect 43 0 44 0;
#X connect 44 0 20 0;
#X connect 45 0 46 0;
#X connect 46 0 14 0;
#X connect 48 0 47 0;
#X connect 50 0 49 0;


More information about the Pd-list mailing list