#N canvas 661 224 1019 676 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 302 246 gemhead;
#X msg 458 469 program \$1;
#X msg 469 492 print_attributes;
#X obj 458 540 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 431 516 t a a;
#X obj 37 174 loadbang;
#X obj 431 410 f \$0;
#X obj 481 346 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000;
#X floatatom 431 364 5 0 0 0 - - - 0;
#X obj 431 387 t b f;
#X obj 314 303 bng 18 250 50 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000;
#X obj 40 402 loadbang;
#X obj 60 450 textfile;
#X obj 60 505 textfile;
#X obj 60 555 textfile;
#X msg 119 451 print;
#X msg 122 506 print;
#X msg 123 554 print;
#X text 453 11 This example introduces tessellation shaders;
#X obj 302 328 glsl shader/09.tessellation;
#X obj 302 277 GEMglPatchParameteri 3;
#X obj 37 218 s \$0_position;
#X msg 37 196 0 -0.8 -0.8 0 0 0.8 0 0.8 -0.8 0;
#X obj 302 578 gemvertexbuffer \; resize 3 \; draw patches;
#X msg 431 434 attribute position \$1_position, f 32;
#X obj 37 259 table \$0_position 9;
#X msg 60 426 read shader/09.tessellation.vert cr;
#X obj 60 605 textfile;
#X msg 123 604 print;
#X msg 60 480 read shader/09.tessellation.tesc cr;
#X msg 60 532 read shader/09.tessellation.tese cr;
#X msg 60 582 read shader/09.tessellation.frag cr;
#X text 283 34 This shader pipeline performs tessellation on a triangle primitive. Here's how it works: \; \; - The vertex shader (09.tessellation.vert) passes the original triangle vertices without modification. \; - The tessellation control shader (09.tessellation.tesc) sets up tessellation levels (5.0 for inner and outer edges) and passes vertex data to the tessellation evaluation shader. \; - The tessellation evaluation shader (09.tessellation.tese) subdivides the triangle into smaller triangles based on the tessellation levels and interpolates positions and normals for each new vertex. It also calculates pseudo random colors for each new vertex using cosine functions based on position. \; - Finally \, the fragment shader (09.tessellation.frag) renders each fragment with the color computed during tessellation. \; \; The result is a single triangle subdivided into many smaller triangles with a procedural color pattern that creates a visual effect with color variations based on position., f 94;
#X connect 0 0 1 0;
#X connect 2 0 24 0;
#X connect 3 0 8 0;
#X connect 4 0 8 0;
#X connect 8 0 27 0;
#X connect 8 1 5 0;
#X connect 9 0 26 0;
#X connect 10 0 28 0;
#X connect 11 0 12 0;
#X connect 12 0 13 0;
#X connect 13 0 10 0;
#X connect 13 1 3 0;
#X connect 14 0 23 0;
#X connect 15 0 33 0;
#X connect 15 0 34 0;
#X connect 15 0 30 0;
#X connect 15 0 35 0;
#X connect 19 0 16 0;
#X connect 20 0 17 0;
#X connect 21 0 18 0;
#X connect 23 0 27 0;
#X connect 23 1 12 0;
#X connect 24 0 23 0;
#X connect 26 0 25 0;
#X connect 28 0 8 0;
#X connect 30 0 16 0;
#X connect 32 0 31 0;
#X connect 33 0 17 0;
#X connect 34 0 18 0;
#X connect 35 0 31 0;
