#N canvas 34 73 724 516 10;
#X declare -lib Gem;
#X text 471 28 Example:;
#X obj 7 64 cnv 15 450 265 empty empty empty 20 12 0 14 #e0e0e0 #404040 0;
#X obj 8 377 cnv 15 450 120 empty empty empty 20 12 0 14 #e0e0e0 #404040 0;
#X text 19 374 Inlets:;
#X obj 8 337 cnv 15 450 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0;
#X text 17 336 Arguments:;
#X text 452 8 GEM object;
#X text 37 386 Inlet 1: gemlist;
#X text 22 468 Outlets:;
#X text 34 481 Outlet 1: gemlist;
#X obj 468 47 cnv 15 225 400 empty empty empty 20 12 0 14 #dce4fc #404040 0;
#X obj 473 49 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0;
#X obj 472 197 cnv 15 220 210 empty empty empty 20 12 0 14 #14e814 #404040 0;
#X obj 483 128 gemhead;
#X text 53 30 Class: non-geometric object;
#X msg 489 316 1 1 1;
#X obj 482 385 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1;
#X msg 500 385 debug \$1;
#X floatatom 563 132 5 0 0 0 - - - 0;
#X obj 586 55 cnv 15 85 50 empty empty empty 20 12 0 14 #14e814 #404040 0;
#X msg 588 81 lighting \$1;
#X obj 588 59 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1;
#X msg 489 335 1 1 0;
#X text 18 186 The second inlet sets the color of the light-source.;
#X text 17 154 You can adjust the light with [rotate]. If you are lost use "debug" to display the light source as a small cone.;
#X text 33 14 Synopsis: [spot_light];
#X text 7 64 Description: adds a spot-light to the scene;
#X text 37 417 Inlet 1: message: debug 1|0 : show debugging object (default:0), f 64;
#X text 37 447 Inlet 3: list: linear_attenuation \, cone_cutoff_angle \, decay_at_edges, f 69;
#X obj 484 362 spot_light;
#N canvas 611 263 574 368 spheres 0;
#X obj 66 12 gemhead;
#X floatatom 84 243 5 0 0 0 - - - 0;
#X obj 49 14 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1;
#X floatatom 99 43 5 0 0 0 - - - 0;
#X floatatom 132 60 5 0 0 0 - - - 0;
#X floatatom 166 77 5 0 0 0 - - - 0;
#X floatatom 103 261 5 0 0 0 - - - 0;
#X obj 66 96 rotateXYZ 0 0 0;
#X floatatom 106 130 5 0 0 0 - - - 0;
#X floatatom 146 147 5 0 0 0 - - - 0;
#X floatatom 187 163 5 0 0 0 - - - 0;
#X obj 66 183 translateXYZ 0 0 0;
#X obj 306 74 gemhead;
#X floatatom 410 143 5 0 0 0 - - - 0;
#X floatatom 450 160 5 0 0 0 - - - 0;
#X floatatom 491 176 5 0 0 0 - - - 0;
#X floatatom 409 54 5 0 0 0 - - - 0;
#X floatatom 442 71 5 0 0 0 - - - 0;
#X floatatom 476 88 5 0 0 0 - - - 0;
#X obj 373 284 sphere 0.2;
#X msg 304 214 20;
#X obj 302 181 loadbang;
#X obj 376 106 rotateXYZ 0 -70 0;
#X obj 373 232 translateXYZ 1.4 0 0;
#X obj 66 280 sphere 0.9;
#X connect 0 0 7 0;
#X connect 1 0 24 1;
#X connect 2 0 0 0;
#X connect 2 0 12 0;
#X connect 3 0 7 1;
#X connect 4 0 7 2;
#X connect 5 0 7 3;
#X connect 6 0 24 2;
#X connect 7 0 11 0;
#X connect 8 0 11 1;
#X connect 9 0 11 2;
#X connect 10 0 11 3;
#X connect 11 0 24 0;
#X connect 12 0 22 0;
#X connect 13 0 23 1;
#X connect 14 0 23 2;
#X connect 15 0 23 3;
#X connect 16 0 22 1;
#X connect 17 0 22 2;
#X connect 18 0 22 3;
#X connect 20 0 19 2;
#X connect 20 0 24 2;
#X connect 21 0 20 0;
#X connect 22 0 23 0;
#X connect 23 0 19 0;
#X restore 476 418 pd spheres;
#X text 15 262 Keep in mind that the attributes have to be set before rendering the vertices \, so if you are trying for frame accurate rendering \, you will want to set the gemhead order to a low number so that all of the values of the light get set first.;
#X text 63 348 none;
#X obj 483 176 translateXYZ 0 0 2;
#X floatatom 498 211 5 0 0 1 linear_attenuation - - 0;
#X floatatom 550 248 5 0 0 2 cone_cutoff_angle - - 0;
#X floatatom 588 278 5 0 0 2 decay_at_edges - - 0;
#X obj 588 297 t b f;
#X obj 550 317 t b f;
#X text 490 299 color;
#X obj 483 150 rotateXYZ -33 0 0;
#X text 37 432 Inlet 2: list: 3(RGB) float values;
#X text 17 205 The third inlet receives a list of three floats: linear_attenuation: only accepts positive values cone_cutoff_angle: 0-90 or 180 decay_at_edges/exponent: 0-128;
#X text 19 81 [spot_light] produces a light which is at a variable distance from the scene. It can be used to make a pinpoint light \, or widened for larger illumination. The edges may appear jagged when lighting low polygon models: to smooth \, increase the polygon's # of vertices (or "slices").;
#X obj 548 337 pack 0 90 3;
#X obj 492 265 tgl 20 0 empty \$0-onoff empty 17 7 0 10 #fcfcfc #000000 #000000 0 1;
#X text 480 457 see also:;
#X obj 527 477 world_light;
#X obj 485 477 light;
#X text 37 401 Inlet 1: float: turn light on/off (default:1);
#N canvas 484 243 450 300 META 0;
#X obj 10 25 declare -lib Gem;
#X text 10 45 DESCRIPTION adds a spot-light to the scene;
#X text 10 65 KEYWORDS Gem non-geometric;
#X text 20 85 INLET_0 gemlist float debug;
#X text 20 105 INLET_1 list;
#X text 20 125 INLET_2 list;
#X text 20 145 OUTLET_0 gemlist;
#X text 10 165 AUTHOR IOhannes m zmölnig;
#X text 10 185 LICENSE GPL-2.0-or-later;
#X restore 578 8 pd META;
#X obj 476 56 _gemwin;
#X connect 13 0 40 0;
#X connect 15 0 29 1;
#X connect 16 0 17 0;
#X connect 17 0 29 0;
#X connect 18 0 40 2;
#X connect 20 0 51 0;
#X connect 21 0 20 0;
#X connect 22 0 29 1;
#X connect 33 0 29 0;
#X connect 34 0 44 0;
#X connect 35 0 38 0;
#X connect 36 0 37 0;
#X connect 37 0 44 0;
#X connect 37 1 44 2;
#X connect 38 0 44 0;
#X connect 38 1 44 1;
#X connect 40 0 33 0;
#X connect 44 0 29 2;
#X connect 45 0 29 0;
