#N canvas 474 41 690 677 10;
#X declare -lib Gem;
#X obj 504 179 gemhead;
#X obj 28 199 gemhead 1;
#X obj 28 396 translateXYZ 0 0 -4;
#X obj 28 600 square 4;
#X floatatom 542 505 5 0 0 0 - - - 0;
#X obj 504 525 rotateXYZ -30 0 0;
#X obj 504 551 scaleXYZ 3 3 1;
#X obj 28 448 pix_image ../data/img1.jpg;
#X msg 46 423 open ../data/img2.jpg;
#X text 137 11 This patch need a glsl 3 compliant hardware;
#X text 26 625 draw an image in a framebuffer;
#X text 123 344 this configuration is very important to have full hardware support for vertex texture fetching;
#X text 306 603 this example uses the framebuffer image in the vertex shader in the same way you can do in the pixel shader. This is only possible in this specific configuration (it's a hardware limitation);
#X text 137 56 (nvidia 7000 and 8000 series should work \, ati X1000 series does not \, but later should);
#X obj 504 579 mesh_square 200;
#X text 138 28 As in 2007 \, only good (and new) graphic cards are able to run this patch.;
#N canvas 87 154 247 179 Gem.init 0;
#X obj 118 46 loadbang;
#X msg 118 81 reset;
#X obj 118 113 outlet;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X restore 56 76 pd Gem.init;
#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 26 94 pd gemwin;
#X obj 563 7 declare -lib Gem;
#X obj 504 292 glsl shader/fetching;
#X obj 28 310 gemframebuffer \; rectangle 0 \; type BYTE \; format RGB32 \; dimen 1024 1024;
#X obj 28 545 pix_texture \; rectangle 0 \; quality 0;
#X obj 504 450 pix_texture \; quality 0;
#X connect 0 0 19 0;
#X connect 1 0 20 0;
#X connect 2 0 7 0;
#X connect 4 0 5 1;
#X connect 5 0 6 0;
#X connect 6 0 14 0;
#X connect 7 0 21 0;
#X connect 8 0 7 0;
#X connect 16 0 17 0;
#X connect 19 0 22 0;
#X connect 20 0 2 0;
#X connect 20 1 22 1;
#X connect 21 0 3 0;
#X connect 22 0 5 0;
