cosmetic changes;
[mesa.git] / src / mesa / shader / slang / library / slang_common_builtin_gc.h
1 "\n"
2 "\n"
3 "\n"
4 "\n"
5 "\n"
6 "\n"
7 "\n"
8 "\n"
9 "\n"
10 "\n"
11 "\n"
12 "\n"
13 "\n"
14 "\n"
15 "\n"
16 "\n"
17 "\n"
18 "\n"
19 "\n"
20 "\n"
21 "const int gl_MaxLights = 8;\n"
22 "const int gl_MaxClipPlanes = 6;\n"
23 "const int gl_MaxTextureUnits = 2;\n"
24 "const int gl_MaxTextureCoords = 2;\n"
25 "const int gl_MaxVertexAttribs = 16;\n"
26 "const int gl_MaxVertexUniformComponents = 512;\n"
27 "const int gl_MaxVaryingFloats = 32;\n"
28 "const int gl_MaxVertexTextureImageUnits = 0;\n"
29 "const int gl_MaxCombinedTextureImageUnits = 2;\n"
30 "const int gl_MaxTextureImageUnits = 2;\n"
31 "const int gl_MaxFragmentUniformComponents = 64;\n"
32 "const int gl_MaxDrawBuffers = 1;\n"
33 "\n"
34 "\n"
35 "\n"
36 "\n"
37 "\n"
38 "\n"
39 "\n"
40 "\n"
41 "\n"
42 "\n"
43 "\n"
44 "uniform mat4 gl_ModelViewMatrix;\n"
45 "uniform mat4 gl_ProjectionMatrix;\n"
46 "uniform mat4 gl_ModelViewProjectionMatrix;\n"
47 "uniform mat4 gl_TextureMatrix[gl_MaxTextureCoords];\n"
48 "\n"
49 "\n"
50 "\n"
51 "\n"
52 "\n"
53 "\n"
54 "uniform mat3 gl_NormalMatrix;\n"
55 "\n"
56 "\n"
57 "uniform mat4 gl_ModelViewMatrixInverse;\n"
58 "uniform mat4 gl_ProjectionMatrixInverse;\n"
59 "uniform mat4 gl_ModelViewProjectionMatrixInverse;\n"
60 "uniform mat4 gl_TextureMatrixInverse[gl_MaxTextureCoords];\n"
61 "\n"
62 "uniform mat4 gl_ModelViewMatrixTranspose;\n"
63 "uniform mat4 gl_ProjectionMatrixTranspose;\n"
64 "uniform mat4 gl_ModelViewProjectionMatrixTranspose;\n"
65 "uniform mat4 gl_TextureMatrixTranspose[gl_MaxTextureCoords];\n"
66 "\n"
67 "uniform mat4 gl_ModelViewMatrixInverseTranspose;\n"
68 "uniform mat4 gl_ProjectionMatrixInverseTranspose;\n"
69 "uniform mat4 gl_ModelViewProjectionMatrixInverseTranspose;\n"
70 "uniform mat4 gl_TextureMatrixInverseTranspose[gl_MaxTextureCoords];\n"
71 "\n"
72 "\n"
73 "\n"
74 "\n"
75 "\n"
76 "uniform float gl_NormalScale;\n"
77 "\n"
78 "\n"
79 "\n"
80 "\n"
81 "\n"
82 "struct gl_DepthRangeParameters {\n"
83 " float near;\n"
84 " float far;\n"
85 " float diff;\n"
86 "};\n"
87 "\n"
88 "uniform gl_DepthRangeParameters gl_DepthRange;\n"
89 "\n"
90 "\n"
91 "\n"
92 "\n"
93 "\n"
94 "uniform vec4 gl_ClipPlane[gl_MaxClipPlanes];\n"
95 "\n"
96 "\n"
97 "\n"
98 "\n"
99 "\n"
100 "struct gl_PointParameters {\n"
101 " float size;\n"
102 " float sizeMin;\n"
103 " float sizeMax;\n"
104 " float fadeThresholdSize;\n"
105 " float distanceConstantAttenuation;\n"
106 " float distanceLinearAttenuation;\n"
107 " float distanceQuadraticAttenuation;\n"
108 "};\n"
109 "\n"
110 "uniform gl_PointParameters gl_Point;\n"
111 "\n"
112 "\n"
113 "\n"
114 "\n"
115 "\n"
116 "struct gl_MaterialParameters {\n"
117 " vec4 emission;\n"
118 " vec4 ambient;\n"
119 " vec4 diffuse;\n"
120 " vec4 specular;\n"
121 " float shininess;\n"
122 "};\n"
123 "\n"
124 "uniform gl_MaterialParameters gl_FrontMaterial;\n"
125 "uniform gl_MaterialParameters gl_BackMaterial;\n"
126 "\n"
127 "\n"
128 "\n"
129 "\n"
130 "\n"
131 "struct gl_LightSourceParameters {\n"
132 " vec4 ambient;\n"
133 " vec4 diffuse;\n"
134 " vec4 specular;\n"
135 " vec4 position;\n"
136 " vec4 halfVector;\n"
137 " vec3 spotDirection;\n"
138 " float spotExponent;\n"
139 " float spotCutoff;\n"
140 "\n"
141 " float spotCosCutoff;\n"
142 "\n"
143 " float constantAttenuation;\n"
144 " float linearAttenuation;\n"
145 " float quadraticAttenuation;\n"
146 "};\n"
147 "\n"
148 "uniform gl_LightSourceParameters gl_LightSource[gl_MaxLights];\n"
149 "\n"
150 "struct gl_LightModelParameters {\n"
151 " vec4 ambient;\n"
152 "};\n"
153 "\n"
154 "uniform gl_LightModelParameters gl_LightModel;\n"
155 "\n"
156 "\n"
157 "\n"
158 "\n"
159 "\n"
160 "struct gl_LightModelProducts {\n"
161 " vec4 sceneColor;\n"
162 "};\n"
163 "\n"
164 "uniform gl_LightModelProducts gl_FrontLightModelProduct;\n"
165 "uniform gl_LightModelProducts gl_BackLightModelProduct;\n"
166 "\n"
167 "struct gl_LightProducts {\n"
168 " vec4 ambient;\n"
169 " vec4 diffuse;\n"
170 " vec4 specular;\n"
171 "};\n"
172 "\n"
173 "uniform gl_LightProducts gl_FrontLightProduct[gl_MaxLights];\n"
174 "uniform gl_LightProducts gl_BackLightProduct[gl_MaxLights];\n"
175 "\n"
176 "\n"
177 "\n"
178 "\n"
179 "\n"
180 "uniform vec4 gl_TextureEnvColor[gl_MaxTextureImageUnits];\n"
181 "uniform vec4 gl_EyePlaneS[gl_MaxTextureCoords];\n"
182 "uniform vec4 gl_EyePlaneT[gl_MaxTextureCoords];\n"
183 "uniform vec4 gl_EyePlaneR[gl_MaxTextureCoords];\n"
184 "uniform vec4 gl_EyePlaneQ[gl_MaxTextureCoords];\n"
185 "uniform vec4 gl_ObjectPlaneS[gl_MaxTextureCoords];\n"
186 "uniform vec4 gl_ObjectPlaneT[gl_MaxTextureCoords];\n"
187 "uniform vec4 gl_ObjectPlaneR[gl_MaxTextureCoords];\n"
188 "uniform vec4 gl_ObjectPlaneQ[gl_MaxTextureCoords];\n"
189 "\n"
190 "\n"
191 "\n"
192 "\n"
193 "\n"
194 "struct gl_FogParameters {\n"
195 " vec4 color;\n"
196 " float density;\n"
197 " float start;\n"
198 " float end;\n"
199 " float scale;\n"
200 "};\n"
201 "\n"
202 "uniform gl_FogParameters gl_Fog;\n"
203 "\n"
204 "\n"
205 "\n"
206 "\n"
207 "\n"
208 "\n"
209 "\n"
210 "\n"
211 "\n"
212 "\n"
213 "\n"
214 "\n"
215 "\n"
216 "\n"
217 "\n"
218 "\n"
219 "\n"
220 "\n"
221 "\n"
222 "\n"
223 "\n"
224 "\n"
225 "\n"
226 "\n"
227 "\n"
228 "\n"
229 "\n"
230 "\n"
231 "\n"
232 "\n"
233 "\n"
234 "\n"
235 "\n"
236 "\n"
237 "\n"
238 "\n"
239 "\n"
240 "\n"
241 "\n"
242 "\n"
243 "\n"
244 "\n"
245 "\n"
246 "\n"
247 "float radians (float deg) {\n"
248 " return 3.141593 * deg / 180.0;\n"
249 "}\n"
250 "vec2 radians (vec2 deg) {\n"
251 " return vec2 (radians (deg.x), radians (deg.y));\n"
252 "}\n"
253 "vec3 radians (vec3 deg) {\n"
254 " return vec3 (radians (deg.x), radians (deg.y), radians (deg.z));\n"
255 "}\n"
256 "vec4 radians (vec4 deg) {\n"
257 " return vec4 (radians (deg.x), radians (deg.y), radians (deg.z), radians (deg.w));\n"
258 "}\n"
259 "\n"
260 "\n"
261 "\n"
262 "\n"
263 "\n"
264 "float degrees (float rad) {\n"
265 " return 180.0 * rad / 3.141593;\n"
266 "}\n"
267 "vec2 degrees (vec2 rad) {\n"
268 " return vec2 (degrees (rad.x), degrees (rad.y));\n"
269 "}\n"
270 "vec3 degrees (vec3 rad) {\n"
271 " return vec3 (degrees (rad.x), degrees (rad.y), degrees (rad.z));\n"
272 "}\n"
273 "vec4 degrees (vec4 rad) {\n"
274 " return vec4 (degrees (rad.x), degrees (rad.y), degrees (rad.z), degrees (rad.w));\n"
275 "}\n"
276 "\n"
277 "\n"
278 "\n"
279 "\n"
280 "\n"
281 "float sin (float angle) {\n"
282 " return 0.0;\n"
283 "}\n"
284 "vec2 sin (vec2 angle) {\n"
285 " return vec2 (sin (angle.x), sin (angle.y));\n"
286 "}\n"
287 "vec3 sin (vec3 angle) {\n"
288 " return vec3 (sin (angle.x), sin (angle.y), sin (angle.z));\n"
289 "}\n"
290 "vec4 sin (vec4 angle) {\n"
291 " return vec4 (sin (angle.x), sin (angle.y), sin (angle.z), sin (angle.w));\n"
292 "}\n"
293 "\n"
294 "\n"
295 "\n"
296 "\n"
297 "\n"
298 "float cos (float angle) {\n"
299 " return sin (angle + 1.5708);\n"
300 "}\n"
301 "vec2 cos (vec2 angle) {\n"
302 " return vec2 (cos (angle.x), cos (angle.y));\n"
303 "}\n"
304 "vec3 cos (vec3 angle) {\n"
305 " return vec3 (cos (angle.x), cos (angle.y), cos (angle.z));\n"
306 "}\n"
307 "vec4 cos (vec4 angle) {\n"
308 " return vec4 (cos (angle.x), cos (angle.y), cos (angle.z), cos (angle.w));\n"
309 "}\n"
310 "\n"
311 "\n"
312 "\n"
313 "\n"
314 "\n"
315 "float tan (float angle) {\n"
316 " return sin (angle) / cos (angle);\n"
317 "}\n"
318 "vec2 tan (vec2 angle) {\n"
319 " return vec2 (tan (angle.x), tan (angle.y));\n"
320 "}\n"
321 "vec3 tan (vec3 angle) {\n"
322 " return vec3 (tan (angle.x), tan (angle.y), tan (angle.z));\n"
323 "}\n"
324 "vec4 tan (vec4 angle) {\n"
325 " return vec4 (tan (angle.x), tan (angle.y), tan (angle.z), tan (angle.w));\n"
326 "}\n"
327 "\n"
328 "\n"
329 "\n"
330 "\n"
331 "\n"
332 "\n"
333 "float asin (float x) {\n"
334 " return 0.0;\n"
335 "}\n"
336 "vec2 asin (vec2 x) {\n"
337 " return vec2 (asin (x.x), asin (x.y));\n"
338 "}\n"
339 "vec3 asin (vec3 x) {\n"
340 " return vec3 (asin (x.x), asin (x.y), asin (x.z));\n"
341 "}\n"
342 "vec4 asin (vec4 x) {\n"
343 " return vec4 (asin (x.x), asin (x.y), asin (x.z), asin (x.w));\n"
344 "}\n"
345 "\n"
346 "\n"
347 "\n"
348 "\n"
349 "\n"
350 "\n"
351 "float acos (float x) {\n"
352 " return 0.0;\n"
353 "}\n"
354 "vec2 acos (vec2 x) {\n"
355 " return vec2 (acos (x.x), acos (x.y));\n"
356 "}\n"
357 "vec3 acos (vec3 x) {\n"
358 " return vec3 (acos (x.x), acos (x.y), acos (x.z));\n"
359 "}\n"
360 "vec4 acos (vec4 x) {\n"
361 " return vec4 (acos (x.x), acos (x.y), acos (x.z), acos (x.w));\n"
362 "}\n"
363 "\n"
364 "\n"
365 "\n"
366 "\n"
367 "\n"
368 "\n"
369 "\n"
370 "float atan (float x, float y) {\n"
371 " return 0.0;\n"
372 "}\n"
373 "vec2 atan (vec2 x, vec2 y) {\n"
374 " return vec2 (atan (x.x, y.x), atan (x.y, y.y));\n"
375 "}\n"
376 "vec3 atan (vec3 x, vec3 y) {\n"
377 " return vec3 (atan (x.x, y.x), atan (x.y, y.y), atan (x.z, y.z));\n"
378 "}\n"
379 "vec4 atan (vec4 x, vec4 y) {\n"
380 " return vec4 (atan (x.x, y.x), atan (x.y, y.y), atan (x.z, y.z), atan (x.w, y.w));\n"
381 "}\n"
382 "\n"
383 "\n"
384 "\n"
385 "\n"
386 "\n"
387 "\n"
388 "float atan (float y_over_x) {\n"
389 " return 0.0;\n"
390 "}\n"
391 "vec2 atan (vec2 y_over_x) {\n"
392 " return vec2 (atan (y_over_x.x), atan (y_over_x.y));\n"
393 "}\n"
394 "vec3 atan (vec3 y_over_x) {\n"
395 " return vec3 (atan (y_over_x.x), atan (y_over_x.y), atan (y_over_x.z));\n"
396 "}\n"
397 "vec4 atan (vec4 y_over_x) {\n"
398 " return vec4 (atan (y_over_x.x), atan (y_over_x.y), atan (y_over_x.z), atan (y_over_x.w));\n"
399 "}\n"
400 "\n"
401 "\n"
402 "\n"
403 "\n"
404 "\n"
405 "\n"
406 "\n"
407 "\n"
408 "\n"
409 "\n"
410 "\n"
411 "\n"
412 "\n"
413 "float pow (float x, float y) {\n"
414 " return 0.0;\n"
415 "}\n"
416 "vec2 pow (vec2 x, vec2 y) {\n"
417 " return vec2 (pow (x.x, y.x), pow (x.y, y.y));\n"
418 "}\n"
419 "vec3 pow (vec3 x, vec3 y) {\n"
420 " return vec3 (pow (x.x, y.x), pow (x.y, y.y), pow (x.z, y.z));\n"
421 "}\n"
422 "vec4 pow (vec4 x, vec4 y) {\n"
423 " return vec4 (pow (x.x, y.x), pow (x.y, y.y), pow (x.z, y.z), pow (x.w, y.w));\n"
424 "}\n"
425 "\n"
426 "\n"
427 "\n"
428 "\n"
429 "\n"
430 "float exp (float x) {\n"
431 " return pow (2.71828183, x);\n"
432 "}\n"
433 "vec2 exp (vec2 x) {\n"
434 " return vec2 (exp (x.x), exp (x.y));\n"
435 "}\n"
436 "vec3 exp (vec3 x) {\n"
437 " return vec3 (exp (x.x), exp (x.y), exp (x.z));\n"
438 "}\n"
439 "vec4 exp (vec4 x) {\n"
440 " return vec4 (exp (x.x), exp (x.y), exp (x.z), exp (x.w));\n"
441 "}\n"
442 "\n"
443 "\n"
444 "\n"
445 "\n"
446 "\n"
447 "\n"
448 "\n"
449 "float log (float x) {\n"
450 " return log2 (x) / log2 (2.71828183);\n"
451 "}\n"
452 "vec2 log (vec2 x) {\n"
453 " return vec2 (log (x.x), log (x.y));\n"
454 "}\n"
455 "vec3 log (vec3 x) {\n"
456 " return vec3 (log (x.x), log (x.y), log (x.z));\n"
457 "}\n"
458 "vec4 log (vec4 x) {\n"
459 " return vec4 (log (x.x), log (x.y), log (x.z), log (x.w));\n"
460 "}\n"
461 "\n"
462 "\n"
463 "\n"
464 "\n"
465 "\n"
466 "float exp2 (float x) {\n"
467 " return pow (2.0, x);\n"
468 "}\n"
469 "vec2 exp2 (vec2 x) {\n"
470 " return vec2 (exp2 (x.x), exp2 (x.y));\n"
471 "}\n"
472 "vec3 exp2 (vec3 x) {\n"
473 " return vec3 (exp2 (x.x), exp2 (x.y), exp2 (x.z));\n"
474 "}\n"
475 "vec4 exp2 (vec4 x) {\n"
476 " return vec4 (exp2 (x.x), exp2 (x.y), exp2 (x.z), exp2 (x.w));\n"
477 "}\n"
478 "\n"
479 "\n"
480 "\n"
481 "\n"
482 "\n"
483 "\n"
484 "\n"
485 "float log2 (float x) {\n"
486 " return 0.0;\n"
487 "}\n"
488 "vec2 log2 (vec2 x) {\n"
489 " return vec2 (log2 (x.x), log2 (x.y));\n"
490 "}\n"
491 "vec3 log2 (vec3 x) {\n"
492 " return vec3 (log2 (x.x), log2 (x.y), log2 (x.z));\n"
493 "}\n"
494 "vec4 log2 (vec4 x) {\n"
495 " return vec4 (log2 (x.x), log2 (x.y), log2 (x.z), log2 (x.w));\n"
496 "}\n"
497 "\n"
498 "\n"
499 "\n"
500 "\n"
501 "\n"
502 "\n"
503 "float sqrt (float x) {\n"
504 " return pow (x, 0.5);\n"
505 "}\n"
506 "vec2 sqrt (vec2 x) {\n"
507 " return vec2 (sqrt (x.x), sqrt (x.y));\n"
508 "}\n"
509 "vec3 sqrt (vec3 x) {\n"
510 " return vec3 (sqrt (x.x), sqrt (x.y), sqrt (x.z));\n"
511 "}\n"
512 "vec4 sqrt (vec4 x) {\n"
513 " return vec4 (sqrt (x.x), sqrt (x.y), sqrt (x.z), sqrt (x.w));\n"
514 "}\n"
515 "\n"
516 "\n"
517 "\n"
518 "\n"
519 "\n"
520 "\n"
521 "float inversesqrt (float x) {\n"
522 " return 1.0 / sqrt (x);\n"
523 "}\n"
524 "vec2 inversesqrt (vec2 x) {\n"
525 " return vec2 (inversesqrt (x.x), inversesqrt (x.y));\n"
526 "}\n"
527 "vec3 inversesqrt (vec3 x) {\n"
528 " return vec3 (inversesqrt (x.x), inversesqrt (x.y), inversesqrt (x.z));\n"
529 "}\n"
530 "vec4 inversesqrt (vec4 x) {\n"
531 " return vec4 (inversesqrt (x.x), inversesqrt (x.y), inversesqrt (x.z), inversesqrt (x.w));\n"
532 "}\n"
533 "\n"
534 "\n"
535 "\n"
536 "\n"
537 "\n"
538 "\n"
539 "\n"
540 "\n"
541 "\n"
542 "\n"
543 "\n"
544 "float abs (float x) {\n"
545 " return x >= 0.0 ? x : -x;\n"
546 "}\n"
547 "vec2 abs (vec2 x) {\n"
548 " return vec2 (abs (x.x), abs (x.y));\n"
549 "}\n"
550 "vec3 abs (vec3 x) {\n"
551 " return vec3 (abs (x.x), abs (x.y), abs (x.z));\n"
552 "}\n"
553 "vec4 abs (vec4 x) {\n"
554 " return vec4 (abs (x.x), abs (x.y), abs (x.z), abs (x.w));\n"
555 "}\n"
556 "\n"
557 "\n"
558 "\n"
559 "\n"
560 "\n"
561 "float sign (float x) {\n"
562 " return x > 0.0 ? 1.0 : x < 0.0 ? -1.0 : 0.0;\n"
563 "}\n"
564 "vec2 sign (vec2 x) {\n"
565 " return vec2 (sign (x.x), sign (x.y));\n"
566 "}\n"
567 "vec3 sign (vec3 x) {\n"
568 " return vec3 (sign (x.x), sign (x.y), sign (x.z));\n"
569 "}\n"
570 "vec4 sign (vec4 x) {\n"
571 " return vec4 (sign (x.x), sign (x.y), sign (x.z), sign (x.w));\n"
572 "}\n"
573 "\n"
574 "\n"
575 "\n"
576 "\n"
577 "\n"
578 "float floor (float x) {\n"
579 " return 0.0;\n"
580 "}\n"
581 "vec2 floor (vec2 x) {\n"
582 " return vec2 (floor (x.x), floor (x.y));\n"
583 "}\n"
584 "vec3 floor (vec3 x) {\n"
585 " return vec3 (floor (x.x), floor (x.y), floor (x.z));\n"
586 "}\n"
587 "vec4 floor (vec4 x) {\n"
588 " return vec4 (floor (x.x), floor (x.y), floor (x.z), floor (x.w));\n"
589 "}\n"
590 "\n"
591 "\n"
592 "\n"
593 "\n"
594 "\n"
595 "float ceil (float x) {\n"
596 " return 0.0;\n"
597 "}\n"
598 "vec2 ceil (vec2 x) {\n"
599 " return vec2 (ceil (x.x), ceil (x.y));\n"
600 "}\n"
601 "vec3 ceil (vec3 x) {\n"
602 " return vec3 (ceil (x.x), ceil (x.y), ceil (x.z));\n"
603 "}\n"
604 "vec4 ceil (vec4 x) {\n"
605 " return vec4 (ceil (x.x), ceil (x.y), ceil (x.z), ceil (x.w));\n"
606 "}\n"
607 "\n"
608 "\n"
609 "\n"
610 "\n"
611 "\n"
612 "float fract (float x) {\n"
613 " return x - floor (x);\n"
614 "}\n"
615 "vec2 fract (vec2 x) {\n"
616 " return vec2 (fract (x.x), fract (x.y));\n"
617 "}\n"
618 "vec3 fract (vec3 x) {\n"
619 " return vec3 (fract (x.x), fract (x.y), fract (x.z));\n"
620 "}\n"
621 "vec4 fract (vec4 x) {\n"
622 " return vec4 (fract (x.x), fract (x.y), fract (x.z), fract (x.w));\n"
623 "}\n"
624 "\n"
625 "\n"
626 "\n"
627 "\n"
628 "\n"
629 "float mod (float x, float y) {\n"
630 " return x - y * floor (x / y);\n"
631 "}\n"
632 "vec2 mod (vec2 x, float y) {\n"
633 " return vec2 (mod (x.x, y), mod (x.y, y));\n"
634 "}\n"
635 "vec3 mod (vec3 x, float y) {\n"
636 " return vec3 (mod (x.x, y), mod (x.y, y), mod (x.z, y));\n"
637 "}\n"
638 "vec4 mod (vec4 x, float y) {\n"
639 " return vec4 (mod (x.x, y), mod (x.y, y), mod (x.z, y), mod (x.w, y));\n"
640 "}\n"
641 "vec2 mod (vec2 x, vec2 y) {\n"
642 " return vec2 (mod (x.x, y.x), mod (x.y, y.y));\n"
643 "}\n"
644 "vec3 mod (vec3 x, vec3 y) {\n"
645 " return vec3 (mod (x.x, y.x), mod (x.y, y.y), mod (x.z, y.z));\n"
646 "}\n"
647 "vec4 mod (vec4 x, vec4 y) {\n"
648 " return vec4 (mod (x.x, y.x), mod (x.y, y.y), mod (x.z, y.z), mod (x.w, y.w));\n"
649 "}\n"
650 "\n"
651 "\n"
652 "\n"
653 "\n"
654 "\n"
655 "float min (float x, float y) {\n"
656 " return y < x ? y : x;\n"
657 "}\n"
658 "vec2 min (vec2 x, float y) {\n"
659 " return vec2 (min (x.x, y), min (x.y, y));\n"
660 "}\n"
661 "vec3 min (vec3 x, float y) {\n"
662 " return vec3 (min (x.x, y), min (x.y, y), min (x.z, y));\n"
663 "}\n"
664 "vec4 min (vec4 x, float y) {\n"
665 " return vec4 (min (x.x, y), min (x.y, y), min (x.z, y), min (x.w, y));\n"
666 "}\n"
667 "vec2 min (vec2 x, vec2 y) {\n"
668 " return vec2 (min (x.x, y.x), min (x.y, y.y));\n"
669 "}\n"
670 "vec3 min (vec3 x, vec3 y) {\n"
671 " return vec3 (min (x.x, y.x), min (x.y, y.y), min (x.z, y.z));\n"
672 "}\n"
673 "vec4 min (vec4 x, vec4 y) {\n"
674 " return vec4 (min (x.x, y.x), min (x.y, y.y), min (x.z, y.z), min (x.w, y.w));\n"
675 "}\n"
676 "\n"
677 "\n"
678 "\n"
679 "\n"
680 "\n"
681 "float max (float x, float y) {\n"
682 " return min (y, x);\n"
683 "}\n"
684 "vec2 max (vec2 x, float y) {\n"
685 " return vec2 (max (x.x, y), max (x.y, y));\n"
686 "}\n"
687 "vec3 max (vec3 x, float y) {\n"
688 " return vec3 (max (x.x, y), max (x.y, y), max (x.z, y));\n"
689 "}\n"
690 "vec4 max (vec4 x, float y) {\n"
691 " return vec4 (max (x.x, y), max (x.y, y), max (x.z, y), max (x.w, y));\n"
692 "}\n"
693 "vec2 max (vec2 x, vec2 y) {\n"
694 " return vec2 (max (x.x, y.x), max (x.y, y.y));\n"
695 "}\n"
696 "vec3 max (vec3 x, vec3 y) {\n"
697 " return vec3 (max (x.x, y.x), max (x.y, y.y), max (x.z, y.z));\n"
698 "}\n"
699 "vec4 max (vec4 x, vec4 y) {\n"
700 " return vec4 (max (x.x, y.x), max (x.y, y.y), max (x.z, y.z), max (x.w, y.w));\n"
701 "}\n"
702 "\n"
703 "\n"
704 "\n"
705 "\n"
706 "\n"
707 "\n"
708 "\n"
709 "\n"
710 "float clamp (float x, float minVal, float maxVal) {\n"
711 " return min (max (x, minVal), maxVal);\n"
712 "}\n"
713 "vec2 clamp (vec2 x, float minVal, float maxVal) {\n"
714 " return vec2 (clamp (x.x, minVal, maxVal), clamp (x.y, minVal, maxVal));\n"
715 "}\n"
716 "vec3 clamp (vec3 x, float minVal, float maxVal) {\n"
717 " return vec3 (clamp (x.x, minVal, maxVal), clamp (x.y, minVal, maxVal),\n"
718 " clamp (x.z, minVal, maxVal));\n"
719 "}\n"
720 "vec4 clamp (vec4 x, float minVal, float maxVal) {\n"
721 " return vec4 (clamp (x.x, minVal, maxVal), clamp (x.y, minVal, maxVal),\n"
722 " clamp (x.z, minVal, maxVal), clamp (x.w, minVal, maxVal));\n"
723 "}\n"
724 "vec2 clamp (vec2 x, vec2 minVal, vec2 maxVal) {\n"
725 " return vec2 (clamp (x.x, minVal.x, maxVal.x), clamp (x.y, minVal.y, maxVal.y));\n"
726 "}\n"
727 "vec3 clamp (vec3 x, vec3 minVal, vec3 maxVal) {\n"
728 " return vec3 (clamp (x.x, minVal.x, maxVal.x), clamp (x.y, minVal.y, maxVal.y),\n"
729 " clamp (x.z, minVal.z, maxVal.z));\n"
730 "}\n"
731 "vec4 clamp (vec4 x, vec4 minVal, vec4 maxVal) {\n"
732 " return vec4 (clamp (x.x, minVal.x, maxVal.y), clamp (x.y, minVal.y, maxVal.y),\n"
733 " clamp (x.z, minVal.z, maxVal.z), clamp (x.w, minVal.w, maxVal.w));\n"
734 "}\n"
735 "\n"
736 "\n"
737 "\n"
738 "\n"
739 "\n"
740 "float mix (float x, float y, float a) {\n"
741 " return x * (1.0 - a) + y * a;\n"
742 "}\n"
743 "vec2 mix (vec2 x, vec2 y, float a) {\n"
744 " return vec2 (mix (x.x, y.x, a), mix (x.y, y.y, a));\n"
745 "}\n"
746 "vec3 mix (vec3 x, vec3 y, float a) {\n"
747 " return vec3 (mix (x.x, y.x, a), mix (x.y, y.y, a), mix (x.z, y.z, a));\n"
748 "}\n"
749 "vec4 mix (vec4 x, vec4 y, float a) {\n"
750 " return vec4 (mix (x.x, y.x, a), mix (x.y, y.y, a), mix (x.z, y.z, a), mix (x.w, y.w, a));\n"
751 "}\n"
752 "vec2 mix (vec2 x, vec2 y, vec2 a) {\n"
753 " return vec2 (mix (x.x, y.x, a.x), mix (x.y, y.y, a.y));\n"
754 "}\n"
755 "vec3 mix (vec3 x, vec3 y, vec3 a) {\n"
756 " return vec3 (mix (x.x, y.x, a.x), mix (x.y, y.y, a.y), mix (x.z, y.z, a.z));\n"
757 "}\n"
758 "vec4 mix (vec4 x, vec4 y, vec4 a) {\n"
759 " return vec4 (mix (x.x, y.x, a.x), mix (x.y, y.y, a.y), mix (x.z, y.z, a.z),\n"
760 " mix (x.w, y.w, a.w));\n"
761 "}\n"
762 "\n"
763 "\n"
764 "\n"
765 "\n"
766 "\n"
767 "float step (float edge, float x) {\n"
768 " return x < edge ? 0.0 : 1.0;\n"
769 "}\n"
770 "vec2 step (float edge, vec2 x) {\n"
771 " return vec2 (step (edge, x.x), step (edge, x.y));\n"
772 "}\n"
773 "vec3 step (float edge, vec3 x) {\n"
774 " return vec3 (step (edge, x.x), step (edge, x.y), step (edge, x.z));\n"
775 "}\n"
776 "vec4 step (float edge, vec4 x) {\n"
777 " return vec4 (step (edge, x.x), step (edge, x.y), step (edge, x.z), step (edge, x.w));\n"
778 "}\n"
779 "vec2 step (vec2 edge, vec2 x) {\n"
780 " return vec2 (step (edge.x, x.x), step (edge.y, x.y));\n"
781 "}\n"
782 "vec3 step (vec3 edge, vec3 x) {\n"
783 " return vec3 (step (edge.x, x.x), step (edge.y, x.y), step (edge.z, x.z));\n"
784 "}\n"
785 "vec4 step (vec4 edge, vec4 x) {\n"
786 " return vec4 (step (edge.x, x.x), step (edge.y, x.y), step (edge.z, x.z), step (edge.w, x.w));\n"
787 "}\n"
788 "\n"
789 "\n"
790 "\n"
791 "\n"
792 "\n"
793 "\n"
794 "\n"
795 "\n"
796 "\n"
797 "\n"
798 "float smoothstep (float edge0, float edge1, float x) {\n"
799 " const float t = clamp ((x - edge0) / (edge1 - edge0), 0.0, 1.0);\n"
800 " return t * t * (3.0 - 2.0 * t);\n"
801 "}\n"
802 "vec2 smoothstep (float edge0, float edge1, vec2 x) {\n"
803 " return vec2 (smoothstep (edge0, edge1, x.x), smoothstep (edge0, edge1, x.y));\n"
804 "}\n"
805 "vec3 smoothstep (float edge0, float edge1, vec3 x) {\n"
806 " return vec3 (smoothstep (edge0, edge1, x.x), smoothstep (edge0, edge1, x.y),\n"
807 " smoothstep (edge0, edge1, x.z));\n"
808 "}\n"
809 "vec4 smoothstep (float edge0, float edge1, vec4 x) {\n"
810 " return vec4 (smoothstep (edge0, edge1, x.x), smoothstep (edge0, edge1, x.y),\n"
811 " smoothstep (edge0, edge1, x.z), smoothstep (edge0, edge1, x.w));\n"
812 "}\n"
813 "vec2 smoothstep (vec2 edge0, vec2 edge1, vec2 x) {\n"
814 " return vec2 (smoothstep (edge0.x, edge1.x, x.x), smoothstep (edge0.y, edge1.y, x.y));\n"
815 "}\n"
816 "vec3 smoothstep (vec3 edge0, vec3 edge1, vec3 x) {\n"
817 " return vec3 (smoothstep (edge0.x, edge1.x, x.x), smoothstep (edge0.y, edge1.y, x.y),\n"
818 " smoothstep (edge0.z, edge1.z, x.z));\n"
819 "}\n"
820 "vec4 smoothstep (vec4 edge0, vec4 edge1, vec4 x) {\n"
821 " return vec4 (smoothstep (edge0.x, edge1.x, x.x), smoothstep (edge0.y, edge1.y, x.y),\n"
822 " smoothstep (edge0.z, edge1.z, x.z), smoothstep (edge0.w, edge1.w, x.w));\n"
823 "}\n"
824 "\n"
825 "\n"
826 "\n"
827 "\n"
828 "\n"
829 "\n"
830 "\n"
831 "\n"
832 "\n"
833 "\n"
834 "\n"
835 "float dot (float x, float y) {\n"
836 " return x * y;\n"
837 "}\n"
838 "float dot (vec2 x, vec2 y) {\n"
839 " return dot (x.x, y.x) + dot (x.y, y.y);\n"
840 "}\n"
841 "float dot (vec3 x, vec3 y) {\n"
842 " return dot (x.x, y.x) + dot (x.y, y.y) + dot (x.z, y.z);\n"
843 "}\n"
844 "float dot (vec4 x, vec4 y) {\n"
845 " return dot (x.x, y.x) + dot (x.y, y.y) + dot (x.z, y.z) + dot (x.w, y.w);\n"
846 "}\n"
847 "\n"
848 "\n"
849 "\n"
850 "\n"
851 "\n"
852 "float length (float x) {\n"
853 " return sqrt (dot (x, x));\n"
854 "}\n"
855 "float length (vec2 x) {\n"
856 " return sqrt (dot (x, x));\n"
857 "}\n"
858 "float length (vec3 x) {\n"
859 " return sqrt (dot (x, x));\n"
860 "}\n"
861 "float length (vec4 x) {\n"
862 " return sqrt (dot (x, x));\n"
863 "}\n"
864 "\n"
865 "\n"
866 "\n"
867 "\n"
868 "\n"
869 "float distance (float x, float y) {\n"
870 " return length (x - y);\n"
871 "}\n"
872 "float distance (vec2 x, vec2 y) {\n"
873 " return length (x - y);\n"
874 "}\n"
875 "float distance (vec3 x, vec3 y) {\n"
876 " return length (x - y);\n"
877 "}\n"
878 "float distance (vec4 x, vec4 y) {\n"
879 " return length (x - y);\n"
880 "}\n"
881 "\n"
882 "\n"
883 "\n"
884 "\n"
885 "\n"
886 "\n"
887 "\n"
888 "\n"
889 "vec3 cross (vec3 x, vec3 y) {\n"
890 " return vec3 (x.y * y.z - y.y * x.z, x.z * y.x - y.z * x.x, x.x * y.y - y.x * x.y);\n"
891 "}\n"
892 "\n"
893 "\n"
894 "\n"
895 "\n"
896 "\n"
897 "float normalize (float x) {\n"
898 " return 1.0;\n"
899 "}\n"
900 "vec2 normalize (vec2 x) {\n"
901 " return x / length (x);\n"
902 "}\n"
903 "vec3 normalize (vec3 x) {\n"
904 " return x / length (x);\n"
905 "}\n"
906 "vec4 normalize (vec4 x) {\n"
907 " return x / length (x);\n"
908 "}\n"
909 "\n"
910 "\n"
911 "\n"
912 "\n"
913 "\n"
914 "float faceforward (float N, float I, float Nref) {\n"
915 " return dot (Nref, I) < 0.0 ? N : -N;\n"
916 "}\n"
917 "vec2 faceforward (vec2 N, vec2 I, vec2 Nref) {\n"
918 " return dot (Nref, I) < 0.0 ? N : -N;\n"
919 "}\n"
920 "vec3 faceforward (vec3 N, vec3 I, vec3 Nref) {\n"
921 " return dot (Nref, I) < 0.0 ? N : -N;\n"
922 "}\n"
923 "vec4 faceforward (vec4 N, vec4 I, vec4 Nref) {\n"
924 " return dot (Nref, I) < 0.0 ? N : -N;\n"
925 "}\n"
926 "\n"
927 "\n"
928 "\n"
929 "\n"
930 "\n"
931 "\n"
932 "\n"
933 "float reflect (float I, float N) {\n"
934 " return I - 2.0 * dot (N, I) * N;\n"
935 "}\n"
936 "vec2 reflect (vec2 I, vec2 N) {\n"
937 " return I - 2.0 * dot (N, I) * N;\n"
938 "}\n"
939 "vec3 reflect (vec3 I, vec3 N) {\n"
940 " return I - 2.0 * dot (N, I) * N;\n"
941 "}\n"
942 "vec4 reflect (vec4 I, vec4 N) {\n"
943 " return I - 2.0 * dot (N, I) * N;\n"
944 "}\n"
945 "\n"
946 "\n"
947 "\n"
948 "\n"
949 "\n"
950 "\n"
951 "\n"
952 "\n"
953 "\n"
954 "\n"
955 "\n"
956 "\n"
957 "\n"
958 "\n"
959 "\n"
960 "float refract (float I, float N, float eta) {\n"
961 " const float k = 1.0 - eta * eta * (1.0 - dot (N, I) * dot (N, I));\n"
962 " if (k < 0.0)\n"
963 " return 0.0;\n"
964 " return eta * I - (eta * dot (N, I) + sqrt (k)) * N;\n"
965 "}\n"
966 "vec2 refract (vec2 I, vec2 N, float eta) {\n"
967 " const float k = 1.0 - eta * eta * (1.0 - dot (N, I) * dot (N, I));\n"
968 " if (k < 0.0)\n"
969 " return vec2 (0.0);\n"
970 " return eta * I - (eta * dot (N, I) + sqrt (k)) * N;\n"
971 "}\n"
972 "vec3 refract (vec3 I, vec3 N, float eta) {\n"
973 " const float k = 1.0 - eta * eta * (1.0 - dot (N, I) * dot (N, I));\n"
974 " if (k < 0.0)\n"
975 " return vec3 (0.0);\n"
976 " return eta * I - (eta * dot (N, I) + sqrt (k)) * N;\n"
977 "}\n"
978 "vec4 refract (vec4 I, vec4 N, float eta) {\n"
979 " const float k = 1.0 - eta * eta * (1.0 - dot (N, I) * dot (N, I));\n"
980 " if (k < 0.0)\n"
981 " return vec4 (0.0);\n"
982 " return eta * I - (eta * dot (N, I) + sqrt (k)) * N;\n"
983 "}\n"
984 "\n"
985 "\n"
986 "\n"
987 "\n"
988 "\n"
989 "\n"
990 "\n"
991 "\n"
992 "\n"
993 "\n"
994 "\n"
995 "mat2 matrixCompMult (mat2 x, mat2 y) {\n"
996 " return mat2 (\n"
997 " x[0].x * y[0].x, x[0].y * y[0].y,\n"
998 " x[1].x * y[1].x, x[1].y * y[1].y\n"
999 " );\n"
1000 "}\n"
1001 "mat3 matrixCompMult (mat3 x, mat3 y) {\n"
1002 " return mat4 (\n"
1003 " x[0].x * y[0].x, x[0].y * y[0].y, x[0].z * y[0].z,\n"
1004 " x[1].x * y[1].x, x[1].y * y[1].y, x[1].z * y[1].z,\n"
1005 " x[2].x * y[2].x, x[2].y * y[2].y, x[2].z * y[2].z\n"
1006 " );\n"
1007 "}\n"
1008 "mat4 matrixCompMult (mat4 x, mat4 y) {\n"
1009 " return mat4 (\n"
1010 " x[0].x * y[0].x, x[0].y * y[0].y, x[0].z * y[0].z + x[0].w * y[0].w,\n"
1011 " x[1].x * y[1].x, x[1].y * y[1].y, x[1].z * y[1].z + x[1].w * y[1].w,\n"
1012 " x[2].x * y[2].x, x[2].y * y[2].y, x[2].z * y[2].z + x[2].w * y[2].w,\n"
1013 " x[3].x * y[3].x, x[3].y * y[3].y, x[3].z * y[3].z + x[3].w * y[3].w\n"
1014 " );\n"
1015 "}\n"
1016 "\n"
1017 "\n"
1018 "\n"
1019 "\n"
1020 "\n"
1021 "\n"
1022 "\n"
1023 "\n"
1024 "\n"
1025 "\n"
1026 "\n"
1027 "\n"
1028 "bvec2 lessThan (vec2 x, vec2 y) {\n"
1029 " return bvec2 (x.x < y.x, x.y < y.y);\n"
1030 "}\n"
1031 "bvec3 lessThan (vec3 x, vec3 y) {\n"
1032 " return bvec3 (x.x < y.x, x.y < y.y, x.z < y.z);\n"
1033 "}\n"
1034 "bvec4 lessThan (vec4 x, vec4 y) {\n"
1035 " return bvec4 (x.x < y.x, x.y < y.y, x.z < y.z, x.w < y.w);\n"
1036 "}\n"
1037 "bvec2 lessThan (ivec2 x, ivec2 y) {\n"
1038 " return bvec2 (x.x < y.x, x.y < y.y);\n"
1039 "}\n"
1040 "bvec3 lessThan (ivec3 x, ivec3 y) {\n"
1041 " return bvec3 (x.x < y.x, x.y < y.y, x.z < y.z);\n"
1042 "}\n"
1043 "bvec4 lessThan (ivec4 x, ivec4 y) {\n"
1044 " return bvec4 (x.x < y.x, x.y < y.y, x.z < y.z, x.w < y.w);\n"
1045 "}\n"
1046 "\n"
1047 "\n"
1048 "\n"
1049 "\n"
1050 "\n"
1051 "bvec2 lessThanEqual (vec2 x, vec2 y) {\n"
1052 " return bvec2 (x.x <= y.x, x.y <= y.y);\n"
1053 "}\n"
1054 "bvec3 lessThanEqual (vec3 x, vec3 y) {\n"
1055 " return bvec3 (x.x <= y.x, x.y <= y.y, x.z <= y.z);\n"
1056 "}\n"
1057 "bvec4 lessThanEqual (vec4 x, vec4 y) {\n"
1058 " return bvec4 (x.x <= y.x, x.y <= y.y, x.z <= y.z, x.w <= y.w);\n"
1059 "}\n"
1060 "bvec2 lessThanEqual (ivec2 x, ivec2 y) {\n"
1061 " return bvec2 (x.x <= y.x, x.y <= y.y);\n"
1062 "}\n"
1063 "bvec3 lessThanEqual (ivec3 x, ivec3 y) {\n"
1064 " return bvec3 (x.x <= y.x, x.y <= y.y, x.z <= y.z);\n"
1065 "}\n"
1066 "bvec4 lessThanEqual (ivec4 x, ivec4 y) {\n"
1067 " return bvec4 (x.x <= y.x, x.y <= y.y, x.z <= y.z, x.w <= y.w);\n"
1068 "}\n"
1069 "\n"
1070 "\n"
1071 "\n"
1072 "\n"
1073 "\n"
1074 "bvec2 greaterThan (vec2 x, vec2 y) {\n"
1075 " return bvec2 (x.x > y.x, x.y > y.y);\n"
1076 "}\n"
1077 "bvec3 greaterThan (vec3 x, vec3 y) {\n"
1078 " return bvec3 (x.x > y.x, x.y > y.y, x.z > y.z);\n"
1079 "}\n"
1080 "bvec4 greaterThan (vec4 x, vec4 y) {\n"
1081 " return bvec4 (x.x > y.x, x.y > y.y, x.z > y.z, x.w > y.w);\n"
1082 "}\n"
1083 "bvec2 greaterThan (ivec2 x, ivec2 y) {\n"
1084 " return bvec2 (x.x > y.x, x.y > y.y);\n"
1085 "}\n"
1086 "bvec3 greaterThan (ivec3 x, ivec3 y) {\n"
1087 " return bvec3 (x.x > y.x, x.y > y.y, x.z > y.z);\n"
1088 "}\n"
1089 "bvec4 greaterThan (ivec4 x, ivec4 y) {\n"
1090 " return bvec4 (x.x > y.x, x.y > y.y, x.z > y.z, x.w > y.w);\n"
1091 "}\n"
1092 "\n"
1093 "\n"
1094 "\n"
1095 "\n"
1096 "\n"
1097 "bvec2 greaterThanEqual (vec2 x, vec2 y) {\n"
1098 " return bvec2 (x.x >= y.x, x.y >= y.y);\n"
1099 "}\n"
1100 "bvec3 greaterThanEqual (vec3 x, vec3 y) {\n"
1101 " return bvec3 (x.x >= y.x, x.y >= y.y, x.z >= y.z);\n"
1102 "}\n"
1103 "bvec4 greaterThanEqual (vec4 x, vec4 y) {\n"
1104 " return bvec4 (x.x >= y.x, x.y >= y.y, x.z >= y.z, x.w >= y.w);\n"
1105 "}\n"
1106 "bvec2 greaterThanEqual (ivec2 x, ivec2 y) {\n"
1107 " return bvec2 (x.x >= y.x, x.y >= y.y);\n"
1108 "}\n"
1109 "bvec3 greaterThanEqual (ivec3 x, ivec3 y) {\n"
1110 " return bvec3 (x.x >= y.x, x.y >= y.y, x.z >= y.z);\n"
1111 "}\n"
1112 "bvec4 greaterThanEqual (ivec4 x, ivec4 y) {\n"
1113 " return bvec4 (x.x >= y.x, x.y >= y.y, x.z >= y.z, x.w >= y.w);\n"
1114 "}\n"
1115 "\n"
1116 "\n"
1117 "\n"
1118 "\n"
1119 "\n"
1120 "bvec2 equal (vec2 x, vec2 y) {\n"
1121 " return bvec2 (x.x == y.x, x.y == y.y);\n"
1122 "}\n"
1123 "bvec3 equal (vec3 x, vec3 y) {\n"
1124 " return bvec3 (x.x == y.x, x.y == y.y, x.z == y.z);\n"
1125 "}\n"
1126 "bvec4 equal (vec4 x, vec4 y) {\n"
1127 " return bvec4 (x.x == y.x, x.y == y.y, x.z == y.z, x.w == y.w);\n"
1128 "}\n"
1129 "bvec2 equal (ivec2 x, ivec2 y) {\n"
1130 " return bvec2 (x.x == y.x, x.y == y.y);\n"
1131 "}\n"
1132 "bvec3 equal (ivec3 x, ivec3 y) {\n"
1133 " return bvec3 (x.x == y.x, x.y == y.y, x.z == y.z);\n"
1134 "}\n"
1135 "bvec4 equal (ivec4 x, ivec4 y) {\n"
1136 " return bvec4 (x.x == y.x, x.y == y.y, x.z == y.z, x.w == y.w);\n"
1137 "}\n"
1138 "\n"
1139 "\n"
1140 "\n"
1141 "\n"
1142 "\n"
1143 "bvec2 notEqual (vec2 x, vec2 y) {\n"
1144 " return bvec2 (x.x != y.x, x.y != y.y);\n"
1145 "}\n"
1146 "bvec3 notEqual (vec3 x, vec3 y) {\n"
1147 " return bvec3 (x.x != y.x, x.y != y.y, x.z != y.z);\n"
1148 "}\n"
1149 "bvec4 notEqual (vec4 x, vec4 y) {\n"
1150 " return bvec4 (x.x != y.x, x.y != y.y, x.z != y.z, x.w != y.w);\n"
1151 "}\n"
1152 "bvec2 notEqual (ivec2 x, ivec2 y) {\n"
1153 " return bvec2 (x.x != y.x, x.y != y.y);\n"
1154 "}\n"
1155 "bvec3 notEqual (ivec3 x, ivec3 y) {\n"
1156 " return bvec3 (x.x != y.x, x.y != y.y, x.z != y.z);\n"
1157 "}\n"
1158 "bvec4 notEqual (ivec4 x, ivec4 y) {\n"
1159 " return bvec4 (x.x != y.x, x.y != y.y, x.z != y.z, x.w != y.w);\n"
1160 "}\n"
1161 "\n"
1162 "\n"
1163 "\n"
1164 "\n"
1165 "\n"
1166 "bool any (bvec2 x) {\n"
1167 " return x.x || x.y;\n"
1168 "}\n"
1169 "bool any (bvec3 x) {\n"
1170 " return x.x || x.y || x.z;\n"
1171 "}\n"
1172 "bool any (bvec4 x) {\n"
1173 " return x.x || x.y || x.z || x.w;\n"
1174 "}\n"
1175 "\n"
1176 "\n"
1177 "\n"
1178 "\n"
1179 "\n"
1180 "bool all (bvec2 x) {\n"
1181 " return x.x && x.y;\n"
1182 "}\n"
1183 "bool all (bvec3 x) {\n"
1184 " return x.x && x.y && x.z;\n"
1185 "}\n"
1186 "bool all (bvec4 x) {\n"
1187 " return x.x && x.y && x.z && x.w;\n"
1188 "}\n"
1189 "\n"
1190 "\n"
1191 "\n"
1192 "\n"
1193 "\n"
1194 "bvec2 not (bvec2 x) {\n"
1195 " return bvec2 (!x.x, !x.y);\n"
1196 "}\n"
1197 "bvec3 not (bvec3 x) {\n"
1198 " return bvec3 (!x.x, !x.y, !x.z);\n"
1199 "}\n"
1200 "bvec4 not (bvec4 x) {\n"
1201 " return bvec4 (!x.x, !x.y, !x.z, !x.w);\n"
1202 "}\n"
1203 "\n"
1204 "\n"
1205 "\n"
1206 "\n"
1207 "\n"
1208 "\n"
1209 "\n"
1210 "\n"
1211 "\n"
1212 "\n"
1213 "\n"
1214 "\n"
1215 "\n"
1216 "\n"
1217 "\n"
1218 "\n"
1219 "\n"
1220 "\n"
1221 "\n"
1222 "\n"
1223 "\n"
1224 "\n"
1225 "\n"
1226 "\n"
1227 "\n"
1228 "\n"
1229 "\n"
1230 "\n"
1231 "\n"
1232 "\n"
1233 "\n"
1234 "\n"
1235 "\n"
1236 "\n"
1237 "\n"
1238 "\n"
1239 "vec4 texture1D (sampler1D sampler, float coord) {\n"
1240 " return vec4 (0.0);\n"
1241 "}\n"
1242 "vec4 texture1DProj (sampler1D sampler, vec2 coord) {\n"
1243 " return texture1D (sampler, coord.s / coord.t);\n"
1244 "}\n"
1245 "vec4 texture1DProj (sampler1D sampler, vec4 coord) {\n"
1246 " return texture1D (sampler, coord.s / coord.q);\n"
1247 "}\n"
1248 "\n"
1249 "\n"
1250 "\n"
1251 "\n"
1252 "\n"
1253 "\n"
1254 "\n"
1255 "\n"
1256 "vec4 texture2D (sampler2D sampler, vec2 coord) {\n"
1257 " return vec4 (0.0);\n"
1258 "}\n"
1259 "vec4 texture2DProj (sampler2D sampler, vec3 coord) {\n"
1260 " return texture2D (sampler, vec2 (coord.s / coord.p, coord.t / coord.p));\n"
1261 "}\n"
1262 "vec4 texture2DProj (sampler2D sampler, vec4 coord) {\n"
1263 " return texture2D (sampler, vec2 (coord.s / coord.q, coord.t / coord.q));\n"
1264 "}\n"
1265 "\n"
1266 "\n"
1267 "\n"
1268 "\n"
1269 "\n"
1270 "\n"
1271 "vec4 texture3D (sampler3D sampler, vec3 coord) {\n"
1272 " return vec4 (0.0);\n"
1273 "}\n"
1274 "vec4 texture3DProj (sampler3D sampler, vec4 coord) {\n"
1275 " return texture3D (sampler, vec3 (coord.s / coord.q, coord.t / coord.q, coord.p / coord.q));\n"
1276 "}\n"
1277 "\n"
1278 "\n"
1279 "\n"
1280 "\n"
1281 "\n"
1282 "\n"
1283 "\n"
1284 "vec4 textureCube (samplerCube sampler, vec3 coord) {\n"
1285 " return vec4 (0.0);\n"
1286 "}\n"
1287 "\n"
1288 "\n"
1289 "\n"
1290 "\n"
1291 "\n"
1292 "\n"
1293 "\n"
1294 "\n"
1295 "\n"
1296 "\n"
1297 "vec4 shadow1D (sampler1DShadow sampler, vec3 coord) {\n"
1298 " return vec4 (0.0);\n"
1299 "}\n"
1300 "\n"
1301 "vec4 shadow2D (sampler2DShadow sampler, vec3 coord) {\n"
1302 " return vec4 (0.0);\n"
1303 "}\n"
1304 "vec4 shadow1DProj (sampler1DShadow sampler, vec4 coord) {\n"
1305 " return shadow1D (sampler, vec3 (coord.s / coord.q, 0.0, coord.p / coord.q));\n"
1306 "}\n"
1307 "vec4 shadow2DProj (sampler2DShadow sampler, vec4 coord) {\n"
1308 " return shadow2D (sampler, vec3 (coord.s / coord.q, coord.t / coord.q, coord.p / coord.q));\n"
1309 "}\n"
1310 "\n"
1311 "\n"
1312 "\n"
1313 "\n"
1314 "\n"
1315 "\n"
1316 "\n"
1317 "\n"
1318 "\n"
1319 "\n"
1320 "\n"
1321 "\n"
1322 "\n"
1323 "\n"
1324 "\n"
1325 "\n"
1326 "\n"
1327 "\n"
1328 "\n"
1329 "\n"
1330 "\n"
1331 "\n"
1332 "\n"
1333 "\n"
1334 "\n"
1335 "float noise1 (float x) {\n"
1336 " return 0.0;\n"
1337 "}\n"
1338 "\n"
1339 "float noise1 (vec2 x) {\n"
1340 " return 0.0;\n"
1341 "}\n"
1342 "\n"
1343 "float noise1 (vec3 x) {\n"
1344 " return 0.0;\n"
1345 "}\n"
1346 "\n"
1347 "float noise1 (vec4 x) {\n"
1348 " return 0.0;\n"
1349 "}\n"
1350 "\n"
1351 "\n"
1352 "\n"
1353 "\n"
1354 "\n"
1355 "vec2 noise2 (float x) {\n"
1356 " return vec2 (0.0);\n"
1357 "}\n"
1358 "\n"
1359 "vec2 noise2 (vec2 x) {\n"
1360 " return vec2 (0.0);\n"
1361 "}\n"
1362 "\n"
1363 "vec2 noise2 (vec3 x) {\n"
1364 " return vec2 (0.0);\n"
1365 "}\n"
1366 "\n"
1367 "vec2 noise2 (vec4 x) {\n"
1368 " return vec2 (0.0);\n"
1369 "}\n"
1370 "\n"
1371 "\n"
1372 "\n"
1373 "\n"
1374 "\n"
1375 "vec3 noise3 (float x) {\n"
1376 " return vec3 (0.0);\n"
1377 "}\n"
1378 "\n"
1379 "vec3 noise3 (vec2 x) {\n"
1380 " return vec3 (0.0);\n"
1381 "}\n"
1382 "\n"
1383 "vec3 noise3 (vec3 x) {\n"
1384 " return vec3 (0.0);\n"
1385 "}\n"
1386 "\n"
1387 "vec3 noise3 (vec4 x) {\n"
1388 " return vec3 (0.0);\n"
1389 "}\n"
1390 "\n"
1391 "\n"
1392 "\n"
1393 "\n"
1394 "\n"
1395 "vec4 noise4 (float x) {\n"
1396 " return vec4 (0.0);\n"
1397 "}\n"
1398 "\n"
1399 "vec4 noise4 (vec2 x) {\n"
1400 " return vec4 (0.0);\n"
1401 "}\n"
1402 "\n"
1403 "vec4 noise4 (vec3 x) {\n"
1404 " return vec4 (0.0);\n"
1405 "}\n"
1406 "\n"
1407 "vec4 noise4 (vec4 x) {\n"
1408 " return vec4 (0.0);\n"
1409 "}\n"
1410 "\n"