#N canvas 201 198 1145 664 10;
#X declare -lib Gem;
#N canvas 640 443 450 300 fps 0;
#X obj 60 28 gemhead;
#X obj 60 68 realtime;
#X obj 60 48 t b b;
#X obj 60 130 /;
#X msg 60 110 1000 \$1;
#X obj 60 235 outlet;
#X obj 60 152 + 0.5;
#X obj 60 214 i;
#N canvas 3 119 450 300 iir 0;
#X obj 63 31 inlet;
#X obj 63 81 +;
#X obj 63 107 / 21;
#X obj 119 138 * 20;
#X obj 63 176 outlet;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 2 0 3 0;
#X connect 2 0 4 0;
#X connect 3 0 1 1;
#X restore 60 182 pd iir;
#X connect 0 0 2 0;
#X connect 1 0 4 0;
#X connect 2 0 1 0;
#X connect 2 1 1 1;
#X connect 3 0 6 0;
#X connect 4 0 3 0;
#X connect 6 0 8 0;
#X connect 7 0 5 0;
#X connect 8 0 7 0;
#X restore 44 104 pd fps;
#X floatatom 44 127 5 0 0 1 fps - - 0;
#X obj 333 104 gemhead;
#X msg 495 417 program \$1;
#X msg 506 440 print_attributes;
#X obj 495 488 print vb;
#X obj 44 9 declare -lib Gem;
#N canvas 340 107 682 322 gemwin 0;
#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1;
#X obj 102 161 r \$0-gemstart;
#X obj 102 182 select 1 0;
#X msg 102 214 create \, 1;
#X msg 177 215 destroy;
#X obj 102 239 t a;
#X obj 318 54 inlet;
#X obj 318 255 gemwin;
#X obj 318 100 t a a;
#X obj 318 287 outlet;
#X obj 350 128 route create destroy;
#X obj 350 150 t b;
#X msg 350 172 1;
#X obj 390 150 t b;
#X msg 390 172 0;
#X obj 350 195 t f;
#X msg 350 219 set \$1;
#X text 118 122 rendering;
#X connect 1 0 2 0;
#X connect 2 0 3 0;
#X connect 2 1 4 0;
#X connect 3 0 5 0;
#X connect 4 0 5 0;
#X connect 5 0 8 0;
#X connect 6 0 8 0;
#X connect 7 0 9 0;
#X connect 8 0 7 0;
#X connect 8 1 10 0;
#X connect 10 0 11 0;
#X connect 10 1 13 0;
#X connect 11 0 12 0;
#X connect 12 0 15 0;
#X connect 13 0 14 0;
#X connect 14 0 15 0;
#X connect 15 0 16 0;
#X connect 16 0 0 0;
#X coords 0 -1 1 1 85 40 1 100 100;
#X restore 42 51 pd gemwin;
#X obj 468 464 t a a;
#X obj 37 174 loadbang;
#X obj 37 228 s \$0_position;
#X obj 37 295 s \$0_color;
#X obj 37 255 loadbang;
#X obj 468 358 f \$0;
#X obj 488 287 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000;
#X floatatom 468 312 5 0 0 0 - - - 0;
#X obj 468 335 t b f;
#X obj 37 319 loadbang;
#X obj 37 359 s \$0_normal;
#X obj 36 381 loadbang;
#X obj 36 422 s \$0_texcoord;
#X obj 345 241 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000;
#X msg 468 382 attribute position \$1_position \, attribute normal \$1_normal \, attribute texCoord \$1_texcoord;
#X obj 691 171 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000;
#X msg 718 187 modelMatrix 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1;
#X msg 718 268 normalMatrix 1 0 0 0 1 0 0 0 1;
#X msg 718 295 lightPos 2 2 2;
#X msg 718 322 lightColor 1 1 1;
#X msg 718 349 ambientColor 0.2 0.2 0.2;
#X msg 718 214 viewMatrix 1 0 0 0 0 1 0 0 0 0 1 0 0 0 -4 1;
#X msg 718 241 projMatrix 1.8 0 0 0 0 1.8 0 0 0 0 -1 -1 0 0 -0.2 0;
#X obj 333 156 translateXYZ;
#X floatatom 356 130 5 0 0 0 - - - 0;
#X text 399 129 <- this is useless since the shader can't access to the transformation matrix. See next patch for more explanations, f 117;
#X text 165 32 tables used by the vertex buffer;
#X msg 37 275 0 1 0 0 0 1 0 0 0 1 1 1 0;
#X msg 37 339 0 0 0 1 0 0 1 0 0 1 0 0 1;
#X msg 36 401 0 0 0 0 1 1 0 1 1;
#X msg 37 194 0 -0.8 -0.8 0 -0.8 0.8 0 0.8 -0.8 0 0.8 0.8 0, f 37;
#X obj 333 526 gemvertexbuffer \; resize 4 \; draw tristrip;
#N canvas 125 216 972 620 drawing_type 0;
#X text 40 50 VBO draw type : same as all openGL primitive;
#X text 46 433 geometry shader out type :;
#X text 70 345 points (pour GL_POINTS) \; lines (for GL_LINES \, GL_LINE_STRIP \, GL_LINE_LOOP) \; triangles (for GL_TRIANGLES \, GL_TRIANGLE_STRIP \, GL_TRIANGLE_FAN \; lines_adjacency (for GL_LINES_ADJACENCY) \; triangles_adjacency (for GL_TRIANGLES_ADJACENCY), f 66;
#X text 50 329 geometry shader in type :;
#X text 69 451 points line_strip triangle_strip, f 17;
#X text 78 71 point for GL_POINTS \; points for GL_POINTS \; line for GL_LINE_LOOP \; lineloop for GL_LINE_LOOP \; lines for GL_LINES \; linestrip for GL_LINE_STRIP \; linesadj for GL_LINES_ADJACENCY \; linestripadj for GL_LINE_STRIP_ADJACENCY \; tri for GL_TRIANGLES \; triangle for GL_TRIANGLES \; tristrip for GL_TRIANGLE_STRIP \; trifan for GL_TRIANGLE_FAN \; triadj for GL_TRIANGLES_ADJACENCY \; tristripadj for GL_TRIANGLE_STRIP_ADJACENCY \; quad for GL_QUADS \; quads for GL_QUADS \; quadstrip for GL_QUAD_STRIP \; strip for GL_TRIANGLE_STRIP \; fill for GL_POLYGON \;;
#X text 41 17 version >= 150;
#X text 529 13 version >=410;
#X text 501 370 GL_PATCHES for teselarisation;
#X text 754 9 version >=420;
#X obj 714 5 cnv 2 2 600 empty empty empty 20 12 0 10 #202020 #404040 0;
#X obj 474 7 cnv 2 2 600 empty empty empty 20 12 0 10 #202020 #404040 0;
#X text 744 461 invocations;
#X restore 981 576 pd drawing_type;
#X obj 40 462 loadbang;
#X obj 60 510 textfile;
#X obj 60 565 textfile;
#X obj 60 615 textfile;
#X text 449 12 This example introduces a simple geometry shader;
#X obj 167 53 table \$0_position 12;
#X obj 167 74 table \$0_color 12;
#X obj 167 95 table \$0_normal 12;
#X obj 167 116 table \$0_texcoord 8;
#X msg 119 511 print;
#X msg 122 566 print;
#X msg 123 614 print;
#X msg 60 486 read shader/07.geometry.frag cr;
#X msg 60 542 read shader/07.geometry.geom cr;
#X msg 60 592 read shader/07.geometry.vert cr;
#X obj 333 266 glsl shader/07.geometry;
#X text 422 39 A geometry shader sits between the vertex and fragment shaders in the graphics pipeline \, allowing for the creation \, modification \, or removal of primitives to dynamically generate new geometries based on the input vertices., f 80;
#X connect 0 0 1 0;
#X connect 2 0 31 0;
#X connect 3 0 8 0;
#X connect 4 0 8 0;
#X connect 8 0 39 0;
#X connect 8 1 5 0;
#X connect 9 0 38 0;
#X connect 12 0 35 0;
#X connect 13 0 22 0;
#X connect 14 0 15 0;
#X connect 15 0 16 0;
#X connect 16 0 13 0;
#X connect 16 1 3 0;
#X connect 17 0 36 0;
#X connect 19 0 37 0;
#X connect 21 0 56 0;
#X connect 22 0 8 0;
#X connect 23 0 24 0;
#X connect 23 0 28 0;
#X connect 23 0 27 0;
#X connect 23 0 26 0;
#X connect 23 0 30 0;
#X connect 23 0 29 0;
#X connect 23 0 25 0;
#X connect 24 0 56 1;
#X connect 25 0 56 1;
#X connect 26 0 56 1;
#X connect 27 0 56 1;
#X connect 28 0 56 1;
#X connect 29 0 56 1;
#X connect 30 0 56 1;
#X connect 31 0 56 0;
#X connect 32 0 31 1;
#X connect 35 0 11 0;
#X connect 36 0 18 0;
#X connect 37 0 20 0;
#X connect 38 0 10 0;
#X connect 41 0 53 0;
#X connect 41 0 54 0;
#X connect 41 0 55 0;
#X connect 50 0 42 0;
#X connect 51 0 43 0;
#X connect 52 0 44 0;
#X connect 53 0 42 0;
#X connect 54 0 43 0;
#X connect 55 0 44 0;
#X connect 56 0 39 0;
#X connect 56 1 15 0;
#X connect 56 1 23 0;
