aboutsummaryrefslogtreecommitdiff
path: root/Gem/glsl_program-help.pd
blob: a38fe9dc7166e335c0839253ea868e00050f3717 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#N canvas 23 79 651 581 10;
#X declare -lib Gem;
#X text 452 8 GEM object;
#X obj 8 307 cnv 15 430 270 empty empty empty 20 12 0 14 -233017 -66577
0;
#X text 11 308 Inlets:;
#X text 10 524 Outlets:;
#X obj 8 272 cnv 15 430 30 empty empty empty 20 12 0 14 -195568 -66577
0;
#X text 17 272 Arguments:;
#X obj 7 56 cnv 15 430 210 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 449 77 cnv 15 170 250 empty empty empty 20 12 0 14 -228992 -66577
0;
#X text 453 60 Example:;
#X obj 450 138 cnv 15 160 90 empty empty empty 20 12 0 14 -24198 -66577
0;
#X text 63 283 <none>;
#X text 14 537 Outlet 1: gemlist;
#X text 21 322 Inlet 1: gemlist;
#X obj 10 213 cnv 15 420 50 empty empty empty 20 12 0 14 -225280 -66577
0;
#X text 71 31 Class: shader object;
#X text 451 345 see also:;
#X obj 451 188 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
;
#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.;
#X text 16 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".;
#X text 14 217 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.;
#X text 21 364 Inlet 1: "shader <list>": list of shader-module IDs
as reported generated by [glsl_fragment] and [glsl_vertex];
#X text 21 395 Inlet 1: "link": link the shader-modules given via the
"shader"-message;
#X text 21 425 Inlet 1: "link <list>": link the shader-modules given
\; (this is the same as "shader <list>"+"link");
#X text 17 198 An ID of the generated program is sent to the 2nd outlet.
;
#X text 14 552 Outlet 2: <float>: ID of the linked glsl_program;
#X text 21 456 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;
#X floatatom 530 211 5 0 0 0 ID - -;
#X msg 462 162 link;
#X msg 518 140 shader 1 3;
#X obj 451 86 gemhead;
#X msg 460 140 print;
#X msg 518 161 link 1 3;
#X obj 513 257 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577
0;
#N canvas 0 0 450 300 gemwin 0;
#X obj 132 136 gemwin;
#X obj 67 89 outlet;
#X obj 67 10 inlet;
#X obj 67 41 route create;
#X msg 67 70 set destroy;
#X msg 142 68 set create;
#X msg 197 134 destroy;
#X msg 132 112 reset \, create \, 1;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 3 0 7 0;
#X connect 3 1 5 0;
#X connect 3 1 6 0;
#X connect 4 0 1 0;
#X connect 5 0 1 0;
#X connect 6 0 0 0;
#X connect 7 0 0 0;
#X restore 518 296 pd gemwin;
#X msg 518 277 create;
#X text 514 256 Create window:;
#X text 21 335 Inlet 1: "print": print info about the GLSL-support
in your openGL implementation and about the linked program;
#N canvas 74 576 496 338 geometry 0;
#X obj 28 27 cnv 15 430 280 empty empty empty 20 12 0 14 -233017 -66577
0;
#X text 33 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;
#X text 31 158 Inlet 1: "geometry_intype <inputtype>": input type of
geometry (default:GL_TRIANGLES);
#X text 31 188 Inlet 1: "geometry_outtype <outputtype>": output type
of geometry (default: GL_TRIANGLE_STRIP);
#X text 31 223 Inlet 1: "geometry_type <inputtype> <outputtype>": combination
of "intype" and "outtype";
#X text 31 262 Inlet 1: "geometry_outvertices <#vertices> <outputtype>":
number of vertices to be created (default: MAX_OUTPUT_VERTICES);
#X text 38 128 you might want to set these before linking the shaders!!
;
#X restore 29 503 pd geometry shaders;
#X obj 453 402 glsl_geometry;
#X obj 518 8 declare -lib Gem;
#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 38 0 39 0;
#X connect 39 0 38 0;