#N canvas 31 0 641 691 10;
#X declare -lib Gem;
#X text 452 8 GEM object;
#X obj 8 337 cnv 15 430 285 empty empty empty 20 12 0 14 #e0e0e0 #404040 0;
#X text 11 338 Inlets:;
#X text 10 574 Outlets:;
#X obj 8 302 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0;
#X text 17 302 Arguments:;
#X obj 7 56 cnv 15 430 240 empty empty empty 20 12 0 14 #e0e0e0 #404040 0;
#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 #dce4fc #404040 0;
#X text 453 60 Example:;
#X obj 450 118 cnv 15 160 130 empty empty empty 20 12 0 14 #14e814 #404040 0;
#X text 63 313 <none>;
#X text 15 587 Outlet 1: gemlist, f 68;
#X text 21 352 Inlet 1: gemlist, f 67;
#X obj 11 626 cnv 15 420 50 empty empty empty 20 12 0 14 #d8fcfc #404040 0;
#X text 71 31 Class: shader object;
#X text 451 345 see also:;
#X obj 451 198 glsl_program;
#X msg 451 272 gemList;
#X obj 453 362 glsl_fragment;
#X obj 453 382 glsl_vertex;
#X text 50 12 Synopsis: [glsl_program];
#X text 13 56 Description: link GLSL-modules into a shader program, f 67;
#X text 14 75 [glsl_program] links together GLSL-modules (created by [glsl_fragment] and [glsl_vertex]) and sets up the resulting openGL-2.0 shader program., f 69;
#X text 14 118 [glsl_program] detects which parameters of the shader can be modified by the user ("uniform variables") \, and allows the user to modify them via messages. If the shader-program has a uniform variable named "bla" of type float \, then you can send a message [bla 0.5( to the [glsl_program] to set this variable to "0.5"., f 69;
#X text 15 630 IMPORTANT NOTE: your openGL-implementation (gfx-card driver \, ...) has to support the GLSL-standard (which is part of openGL-2.0) in order to make use of this object., f 68;
#X text 21 395 Inlet 1: "shader <list>": list of shader-module IDs as reported generated by [glsl_fragment] and [glsl_vertex], f 67;
#X text 21 423 Inlet 1: "link": link the shader-modules given via the "shader"-message, f 67;
#X text 21 451 Inlet 1: "link <list>": link the shader-modules given \; (this is the same as "shader <list>"+"link"), f 67;
#X text 14 275 An ID of the generated program is sent to the 2nd outlet., f 69;
#X text 15 602 Outlet 2: <float>: ID of the linked glsl_program, f 68;
#X text 21 479 Inlet 1: "<uniformName> <uniformParm>...": set the uniform variable of name uniformName to the (list of) uniformParms. this is only valid after successfully linking a program, f 67;
#X floatatom 530 221 5 0 0 0 ID - - 0;
#X msg 462 142 link;
#X msg 518 120 shader 1 3;
#X obj 451 86 gemhead;
#X msg 460 120 print;
#X msg 518 141 link 1 3;
#X text 21 367 Inlet 1: "print": print info about the GLSL-support in your openGL implementation and about the linked program, f 67;
#N canvas 74 576 496 338 geometry 1;
#X obj 28 27 cnv 15 430 280 empty empty empty 20 12 0 14 #e0e0e0 #404040 0;
#X text 31 47 when using geometry-shaders (with [glsl_geometry]) you have to tell [glsl_program] about the input-type (depending on the geometry you feed to the glsl-program) \, the output-type (that you create by the shader) and the number of vertices generated, f 70;
#X text 31 158 Inlet 1: "geometry_intype <inputtype>": input type of geometry (default:GL_TRIANGLES), f 70;
#X text 31 188 Inlet 1: "geometry_outtype <outputtype>": output type of geometry (default: GL_TRIANGLE_STRIP), f 70;
#X text 31 223 Inlet 1: "geometry_type <inputtype> <outputtype>": combination of "intype" and "outtype", f 70;
#X text 38 128 you might want to set these before linking the shaders!!;
#X text 31 262 Inlet 1: "geometry_outvertices <#vertices>": number of vertices to be created (default: MAX_OUTPUT_VERTICES), f 70;
#X restore 29 553 pd geometry shaders;
#X obj 453 402 glsl_geometry;
#N canvas 484 243 450 300 META 0;
#X obj 10 25 declare -lib Gem;
#X text 10 45 DESCRIPTION link GLSL-modules into a shader program, f 67;
#X text 10 65 KEYWORDS Gem openGL shader;
#X text 20 85 INLET_0 geometry_intype geometry_outtype geometry_type geometry_outvertices gemlist print shader link <uniformName> keepuniforms;
#X text 20 105 OUTLET_0 gemlist;
#X text 20 125 OUTLET_1 float;
#X text 10 145 AUTHOR IOhannes m zmölnig;
#X text 10 165 LICENSE GPL-2.0-or-later;
#X restore 518 8 pd META;
#X msg 476 175 keepuniforms 0;
#X text 21 520 Inlet 1: "keepuniforms 1|0" enable(DEFAULT) or disable the caching of uniform variables across reload, f 67;
#X text 14 229 Uniform variables survive linking a new program (if the new program has a compatible uniform of the same name). To clear the cached variables on linking \, set "keepuniforms" to "0"., f 69;
#N canvas 0 0 747 442 uniform 0;
#X text 14 28 [glsl_program] detects which parameters of the shader can be modified by the user ("uniform variables") \, and allows the user to modify them via messages. If the shader-program has a uniform variable named "bla" of type float \, then you can send a message [bla 0.5( to the [glsl_program] to set this variable to "0.5"., f 69;
#X text 14 106 A single uniform can hold multiple values (vectors \, matrices \, arrays). Either pass the values directory \, or pass a single arrayname that holds the values)., f 69;
#X obj 57 406 s \$0-glsl_program;
#X msg 57 201 bla 0.5;
#X text 115 200 set a single valued uniform named 'bla';
#X msg 70 232 myCol 0.5 0.8 0.2;
#X text 186 234 set a multi-valued uniform (e.g. vec3);
#X obj 219 319 table \$0-vals 10;
#X msg 112 273 bang;
#X msg 112 319 myArray \$1;
#X obj 112 296 symbol \$0-val;
#X text 209 289 use tables to set multi-valued uniforms;
#X msg 115 365 myArray[0] 1 2 3 4 5 6 7 8 9 10;
#X text 311 361 compatibility: previous versions of Gem used a "[0]-suffix for arrays. this is now obsolete (but still valid);
#X obj 518 198 cnv 18 180 72 empty empty empty 20 12 0 10 #e0e0e0 #404040 0;
#X text 523 204 uniform float bla \;;
#X text 523 224 uniform vec3 myCol \;;
#X text 523 244 uniform float myArray[10] \;;
#X connect 3 0 2 0;
#X connect 5 0 2 0;
#X connect 8 0 10 0;
#X connect 9 0 2 0;
#X connect 10 0 9 0;
#X connect 12 0 2 0;
#X restore 84 201 pd uniform variables;
#X obj 523 272 _gemwin;
#X connect 16 0 17 0;
#X connect 16 1 31 0;
#X connect 32 0 16 0;
#X connect 33 0 16 0;
#X connect 34 0 16 0;
#X connect 35 0 16 0;
#X connect 36 0 16 0;
#X connect 41 0 16 0;
