#N canvas 291 103 1078 659 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 267 14 gemhead;
#X msg 411 444 program \$1;
#X obj 433 483 cnv 15 120 30 empty empty empty 20 12 0 14 #c4fcc4 #404040 0;
#X msg 441 489 print_attributes;
#X text 490 444 <----- essential for lookup functions;
#X obj 330 560 print vb;
#X obj 44 9 declare -lib Gem;
#X msg 384 370 attribute position \$1_position \, attribute color \$1_color;
#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 303 536 t a a;
#X obj 40 175 table \$0_position 9;
#X obj 40 196 table \$0_color 9;
#X obj 41 235 loadbang;
#X obj 41 283 s \$0_position;
#X obj 40 364 s \$0_color;
#X msg 40 341 0 1 0 0 0 1 0 0 0 1;
#X msg 41 260 0 -0.8 -0.8 0 0 0.8 0 0.8 -0.8 0;
#X obj 40 317 loadbang;
#X text 444 124 OpenGL 3.2 deprecated the fixed-function pipeline \, which was less flexible and harder to optimize \, in favor of the programmable pipeline using shaders \, allowing for more customizable and efficient rendering techniques., f 88;
#X text 445 19 OpenGL 3.2 introduced deprecation of immediate mode rendering \, encouraging the use of Vertex Buffer Objects (VBOs) and Vertex Array Objects (VAOs) for more efficient and modern graphics programming. This shift was made to improve performance and flexibility \, aligning OpenGL with contemporary GPU capabilities and programming practices., f 88;
#X text 445 85 VBOs are crucial because they represent the modern and efficient way to manage vertex data in OpenGL \, replacing the older and less performant immediate mode., f 88;
#X text 444 178 With the deprecation of the fixed-function pipeline in OpenGL 3.2 \, users must now manually handle many aspects that were previously automated \, such as matrix transformations and lighting calculations \, by writing their own shaders and managing buffers \, which offers greater control but requires more effort and understanding of the rendering process., f 88;
#X obj 267 276 glsl shader/01.basic;
#X obj 384 343 \$0;
#X text 445 259 This example demonstrates how to use Vertex Buffer Objects (VBOs) in conjunction with shaders in OpenGL. It illustrates the process of creating and binding a VBO to store vertex data \, and then using a vertex shader and fragment shader to render that data., f 88;
#X text 47 522 click to see the shaders;
#X obj 39 399 loadbang;
#X obj 267 588 gemvertexbuffer \; resize 3 \; draw tri;
#X text 421 393 We are using attribute here \, since it's the way the shader will have access to the VBO data;
#X obj 384 321 t b f;
#X obj 55 449 textfile;
#X obj 39 498 textfile;
#X msg 39 474 read shader/01.basic.frag cr;
#X msg 55 426 read shader/01.basic.vert cr;
#X msg 121 450 print;
#X msg 106 497 print;
#X connect 0 0 1 0;
#X connect 2 0 24 0;
#X connect 3 0 11 0;
#X connect 5 0 11 0;
#X connect 9 0 11 0;
#X connect 11 0 29 0;
#X connect 11 1 7 0;
#X connect 14 0 18 0;
#X connect 17 0 16 0;
#X connect 18 0 15 0;
#X connect 19 0 17 0;
#X connect 24 0 29 0;
#X connect 24 1 31 0;
#X connect 25 0 9 0;
#X connect 28 0 34 0;
#X connect 28 0 35 0;
#X connect 31 0 25 0;
#X connect 31 1 3 0;
#X connect 34 0 33 0;
#X connect 35 0 32 0;
#X connect 36 0 32 0;
#X connect 37 0 33 0;
