p5 2.2.1 → 2.2.2-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/dist/accessibility/color_namer.js +6 -6
  2. package/dist/accessibility/index.js +6 -6
  3. package/dist/app.js +6 -6
  4. package/dist/color/color_conversion.js +6 -6
  5. package/dist/color/creating_reading.js +1 -1
  6. package/dist/color/index.js +2 -2
  7. package/dist/color/p5.Color.js +1 -1
  8. package/dist/color/setting.js +2 -2
  9. package/dist/{constants-DQyACdzq.js → constants-DAnmXDew.js} +1 -1
  10. package/dist/core/constants.js +1 -1
  11. package/dist/core/environment.js +1 -1
  12. package/dist/core/filterShaders.js +1 -1
  13. package/dist/core/friendly_errors/fes_core.js +1 -1
  14. package/dist/core/friendly_errors/file_errors.js +1 -1
  15. package/dist/core/friendly_errors/index.js +1 -1
  16. package/dist/core/friendly_errors/param_validator.js +1 -1
  17. package/dist/core/friendly_errors/sketch_verifier.js +2 -2
  18. package/dist/core/helpers.js +1 -1
  19. package/dist/core/init.js +6 -6
  20. package/dist/core/internationalization.js +1 -1
  21. package/dist/core/legacy.js +6 -6
  22. package/dist/core/main.js +6 -6
  23. package/dist/core/p5.Graphics.js +4 -4
  24. package/dist/core/p5.Renderer.js +3 -3
  25. package/dist/core/p5.Renderer2D.js +6 -6
  26. package/dist/core/p5.Renderer3D.js +4 -4
  27. package/dist/core/rendering.js +4 -4
  28. package/dist/{creating_reading-ZXzcZEsb.js → creating_reading-C7hu6sg1.js} +2 -2
  29. package/dist/dom/dom.js +2 -2
  30. package/dist/dom/index.js +2 -2
  31. package/dist/dom/p5.Element.js +2 -2
  32. package/dist/dom/p5.MediaElement.js +2 -2
  33. package/dist/image/const.js +1 -1
  34. package/dist/image/filterRenderer2D.js +5 -5
  35. package/dist/image/image.js +4 -4
  36. package/dist/image/index.js +4 -4
  37. package/dist/image/loading_displaying.js +4 -4
  38. package/dist/image/p5.Image.js +3 -3
  39. package/dist/io/files.js +4 -4
  40. package/dist/io/index.js +4 -4
  41. package/dist/{ir_builders-DXNgaB9N.js → ir_builders-w12-GSxu.js} +37 -5
  42. package/dist/{main-DvN69W3f.js → main-E-swj5tF.js} +4 -4
  43. package/dist/math/Matrices/Matrix.js +1 -1
  44. package/dist/math/Matrices/MatrixNumjs.js +1 -1
  45. package/dist/math/index.js +1 -1
  46. package/dist/math/p5.Matrix.js +1 -1
  47. package/dist/math/p5.Vector.js +1 -1
  48. package/dist/math/trigonometry.js +1 -1
  49. package/dist/{p5.Renderer-D-5LdCRz.js → p5.Renderer-DOk9UW65.js} +2 -2
  50. package/dist/{rendering-h9unX5K0.js → rendering-B8V5Zt4k.js} +58 -14
  51. package/dist/shape/2d_primitives.js +1 -1
  52. package/dist/shape/attributes.js +1 -1
  53. package/dist/shape/custom_shapes.js +2 -2
  54. package/dist/shape/index.js +2 -2
  55. package/dist/strands/ir_builders.js +1 -1
  56. package/dist/strands/p5.strands.js +1 -1
  57. package/dist/strands/strands_api.js +91 -31
  58. package/dist/strands/strands_conditionals.js +1 -1
  59. package/dist/strands/strands_for.js +2 -2
  60. package/dist/strands/strands_node.js +1 -1
  61. package/dist/type/index.js +3 -3
  62. package/dist/type/p5.Font.js +3 -3
  63. package/dist/type/textCore.js +3 -3
  64. package/dist/webgl/3d_primitives.js +4 -4
  65. package/dist/webgl/GeometryBuilder.js +1 -1
  66. package/dist/webgl/ShapeBuilder.js +1 -1
  67. package/dist/webgl/enums.js +1 -1
  68. package/dist/webgl/index.js +5 -5
  69. package/dist/webgl/interaction.js +1 -1
  70. package/dist/webgl/light.js +4 -4
  71. package/dist/webgl/loading.js +12 -14
  72. package/dist/webgl/material.js +4 -4
  73. package/dist/webgl/p5.Camera.js +4 -4
  74. package/dist/webgl/p5.Framebuffer.js +4 -4
  75. package/dist/webgl/p5.Geometry.js +1 -1
  76. package/dist/webgl/p5.Quat.js +1 -1
  77. package/dist/webgl/p5.RendererGL.js +5 -5
  78. package/dist/webgl/p5.Texture.js +4 -4
  79. package/dist/webgl/strands_glslBackend.js +1 -1
  80. package/dist/webgl/text.js +5 -5
  81. package/dist/webgl/utils.js +4 -4
  82. package/dist/webgpu/index.js +2 -2
  83. package/dist/webgpu/p5.RendererWebGPU.js +13 -4
  84. package/dist/webgpu/strands_wgslBackend.js +5 -4
  85. package/lib/p5.esm.js +196 -62
  86. package/lib/p5.esm.min.js +1 -1
  87. package/lib/p5.js +196 -62
  88. package/lib/p5.min.js +1 -1
  89. package/lib/p5.webgpu.esm.js +51 -9
  90. package/lib/p5.webgpu.js +51 -9
  91. package/lib/p5.webgpu.min.js +1 -1
  92. package/package.json +1 -1
  93. package/types/global.d.ts +1453 -1383
  94. package/types/p5.d.ts +729 -694
@@ -1,15 +1,15 @@
1
1
  import '../core/helpers.js';
2
- import '../constants-DQyACdzq.js';
3
- export { b as default } from '../rendering-h9unX5K0.js';
2
+ import '../constants-DAnmXDew.js';
3
+ export { b as default } from '../rendering-B8V5Zt4k.js';
4
4
  import 'omggif';
5
5
  import 'gifenc';
6
- import '../creating_reading-ZXzcZEsb.js';
6
+ import '../creating_reading-C7hu6sg1.js';
7
7
  import 'colorjs.io/fn';
8
8
  import '../color/color_spaces/hsb.js';
9
9
  import '../dom/p5.Element.js';
10
10
  import '../dom/p5.File.js';
11
11
  import '../io/p5.XML.js';
12
- import '../p5.Renderer-D-5LdCRz.js';
12
+ import '../p5.Renderer-DOk9UW65.js';
13
13
  import './filters.js';
14
14
  import '../math/p5.Vector.js';
15
15
  import '../shape/custom_shapes.js';
@@ -1,10 +1,10 @@
1
1
  import './filters.js';
2
- export { I as Image, i as default } from '../p5.Renderer-D-5LdCRz.js';
2
+ export { I as Image, i as default } from '../p5.Renderer-DOk9UW65.js';
3
3
  import '../io/utilities.js';
4
- import '../creating_reading-ZXzcZEsb.js';
4
+ import '../creating_reading-C7hu6sg1.js';
5
5
  import 'colorjs.io/fn';
6
6
  import '../color/color_spaces/hsb.js';
7
- import '../constants-DQyACdzq.js';
7
+ import '../constants-DAnmXDew.js';
8
8
  import '../math/p5.Vector.js';
9
9
  import '../shape/custom_shapes.js';
10
10
  import '../core/States.js';
package/dist/io/files.js CHANGED
@@ -1,11 +1,11 @@
1
- import '../p5.Renderer-D-5LdCRz.js';
2
- export { d as default, a as request } from '../rendering-h9unX5K0.js';
1
+ import '../p5.Renderer-DOk9UW65.js';
2
+ export { d as default, a as request } from '../rendering-B8V5Zt4k.js';
3
3
  import './csv.js';
4
4
  import './utilities.js';
5
- import '../creating_reading-ZXzcZEsb.js';
5
+ import '../creating_reading-C7hu6sg1.js';
6
6
  import 'colorjs.io/fn';
7
7
  import '../color/color_spaces/hsb.js';
8
- import '../constants-DQyACdzq.js';
8
+ import '../constants-DAnmXDew.js';
9
9
  import '../image/filters.js';
10
10
  import '../math/p5.Vector.js';
11
11
  import '../shape/custom_shapes.js';
package/dist/io/index.js CHANGED
@@ -1,14 +1,14 @@
1
- import { d as files } from '../rendering-h9unX5K0.js';
1
+ import { d as files } from '../rendering-B8V5Zt4k.js';
2
2
  import table from './p5.Table.js';
3
3
  import tableRow from './p5.TableRow.js';
4
4
  import xml from './p5.XML.js';
5
- import '../constants-DQyACdzq.js';
6
- import '../creating_reading-ZXzcZEsb.js';
5
+ import '../constants-DAnmXDew.js';
6
+ import '../creating_reading-C7hu6sg1.js';
7
7
  import 'colorjs.io/fn';
8
8
  import '../color/color_spaces/hsb.js';
9
9
  import '../dom/p5.Element.js';
10
10
  import '../dom/p5.File.js';
11
- import '../p5.Renderer-D-5LdCRz.js';
11
+ import '../p5.Renderer-DOk9UW65.js';
12
12
  import '../image/filters.js';
13
13
  import '../math/p5.Vector.js';
14
14
  import '../shape/custom_shapes.js';
@@ -42,7 +42,7 @@ class StrandsNode {
42
42
  const baseType = orig?.baseType ?? BaseType.FLOAT;
43
43
 
44
44
  let newValueID;
45
- if (value instanceof StrandsNode) {
45
+ if (value?.isStrandsNode) {
46
46
  newValueID = value.id;
47
47
  } else {
48
48
  const newVal = primitiveConstructorNode(
@@ -97,7 +97,7 @@ class StrandsNode {
97
97
  const baseType = orig?.baseType ?? BaseType.FLOAT;
98
98
 
99
99
  let newValueID;
100
- if (value instanceof StrandsNode) {
100
+ if (value?.isStrandsNode) {
101
101
  newValueID = value.id;
102
102
  } else {
103
103
  const newVal = primitiveConstructorNode(
@@ -215,7 +215,7 @@ function unaryOpNode(strandsContext, nodeOrValue, opCode) {
215
215
  const { dag, cfg } = strandsContext;
216
216
  let dependsOn;
217
217
  let node;
218
- if (nodeOrValue instanceof StrandsNode) {
218
+ if (nodeOrValue?.isStrandsNode) {
219
219
  node = nodeOrValue;
220
220
  } else {
221
221
  const { id, dimension } = primitiveConstructorNode(strandsContext, { baseType: BaseType.FLOAT, dimension: null }, nodeOrValue);
@@ -429,6 +429,20 @@ function constructTypeFromIDs(strandsContext, typeInfo, strandsNodesArray) {
429
429
 
430
430
  function primitiveConstructorNode(strandsContext, typeInfo, dependsOn) {
431
431
  const cfg = strandsContext.cfg;
432
+ dependsOn = (Array.isArray(dependsOn) ? dependsOn : [dependsOn])
433
+ .flat(Infinity)
434
+ .map(a => {
435
+ if (
436
+ a.isStrandsNode &&
437
+ a.typeInfo().baseType === BaseType.INT &&
438
+ // TODO: handle ivec inputs instead of just int scalars
439
+ a.typeInfo().dimension === 1
440
+ ) {
441
+ return castToFloat(strandsContext, a);
442
+ } else {
443
+ return a;
444
+ }
445
+ });
432
446
  const { mappedDependencies, inferredTypeInfo } = mapPrimitiveDepsToIDs(strandsContext, typeInfo, dependsOn);
433
447
 
434
448
  const finalType = {
@@ -444,6 +458,24 @@ function primitiveConstructorNode(strandsContext, typeInfo, dependsOn) {
444
458
  return { id, dimension: finalType.dimension, components: mappedDependencies };
445
459
  }
446
460
 
461
+ function castToFloat(strandsContext, dep) {
462
+ const { id, dimension } = functionCallNode(
463
+ strandsContext,
464
+ strandsContext.backend.getTypeName('float', dep.typeInfo().dimension),
465
+ [dep],
466
+ {
467
+ overloads: [{
468
+ params: [dep.typeInfo()],
469
+ returnType: {
470
+ ...dep.typeInfo(),
471
+ baseType: BaseType.FLOAT,
472
+ },
473
+ }],
474
+ }
475
+ );
476
+ return createStrandsNode(id, dimension, strandsContext);
477
+ }
478
+
447
479
  function structConstructorNode(strandsContext, structTypeInfo, rawUserArgs) {
448
480
  const { cfg, dag } = strandsContext;
449
481
  const { identifer, properties } = structTypeInfo;
@@ -663,7 +695,7 @@ function swizzleTrap(id, dimension, strandsContext, onRebind) {
663
695
  // This may not be the most efficient way, as we swizzle each component individually,
664
696
  // so that .xyz becomes .x, .y, .z
665
697
  let scalars = [];
666
- if (value instanceof StrandsNode) {
698
+ if (value?.isStrandsNode) {
667
699
  if (value.dimension === 1) {
668
700
  scalars = Array(chars.length).fill(value);
669
701
  } else if (value.dimension === chars.length) {
@@ -722,4 +754,4 @@ function swizzleTrap(id, dimension, strandsContext, onRebind) {
722
754
  return trap;
723
755
  }
724
756
 
725
- export { StrandsNode as S, structInstanceNode as a, structConstructorNode as b, createStrandsNode as c, binaryOpNode as d, scalarLiteralNode as e, functionCallNode as f, constructTypeFromIDs as g, swizzleNode as h, swizzleTrap as i, memberAccessNode as m, primitiveConstructorNode as p, statementNode as s, unaryOpNode as u, variableNode as v };
757
+ export { StrandsNode as S, structInstanceNode as a, structConstructorNode as b, createStrandsNode as c, binaryOpNode as d, scalarLiteralNode as e, functionCallNode as f, constructTypeFromIDs as g, castToFloat as h, swizzleNode as i, swizzleTrap as j, memberAccessNode as m, primitiveConstructorNode as p, statementNode as s, unaryOpNode as u, variableNode as v };
@@ -1,12 +1,12 @@
1
- import { P as P2D, ac as WEBGL, B as BLEND, al as _DEFAULT_FILL, am as _DEFAULT_STROKE, w as ROUND, b as REMOVE, S as SUBTRACT, D as DARKEST, L as LIGHTEST, an as DIFFERENCE, M as MULTIPLY, E as EXCLUSION, a as SCREEN, R as REPLACE, ao as OVERLAY, ap as HARD_LIGHT, aq as SOFT_LIGHT, ar as DODGE, as as BURN, A as ADD, at as PIE, au as CHORD, q as TWO_PI, x as SQUARE, y as PROJECT, z as BEVEL, I as MITER, a9 as RIGHT, v as CENTER, av as LEFT, aw as BOTTOM, ax as BASELINE, ay as TOP, Q as OPEN, az as VERSION, a3 as constants } from './constants-DQyACdzq.js';
1
+ import { P as P2D, ac as WEBGL, B as BLEND, al as _DEFAULT_FILL, am as _DEFAULT_STROKE, w as ROUND, b as REMOVE, S as SUBTRACT, D as DARKEST, L as LIGHTEST, an as DIFFERENCE, M as MULTIPLY, E as EXCLUSION, a as SCREEN, R as REPLACE, ao as OVERLAY, ap as HARD_LIGHT, aq as SOFT_LIGHT, ar as DODGE, as as BURN, A as ADD, at as PIE, au as CHORD, q as TWO_PI, x as SQUARE, y as PROJECT, z as BEVEL, I as MITER, a9 as RIGHT, v as CENTER, av as LEFT, aw as BOTTOM, ax as BASELINE, ay as TOP, Q as OPEN, az as VERSION, a3 as constants } from './constants-DAnmXDew.js';
2
2
  import transform from './core/transform.js';
3
3
  import structure from './core/structure.js';
4
4
  import environment from './core/environment.js';
5
- import { G as Graphics, k as rendering, n as graphics } from './rendering-h9unX5K0.js';
6
- import { R as Renderer, I as Image, r as renderer } from './p5.Renderer-D-5LdCRz.js';
5
+ import { G as Graphics, k as rendering, n as graphics } from './rendering-B8V5Zt4k.js';
6
+ import { R as Renderer, I as Image, r as renderer } from './p5.Renderer-DOk9UW65.js';
7
7
  import { Element } from './dom/p5.Element.js';
8
8
  import { MediaElement } from './dom/p5.MediaElement.js';
9
- import { b as RGBHDR } from './creating_reading-ZXzcZEsb.js';
9
+ import { b as RGBHDR } from './creating_reading-C7hu6sg1.js';
10
10
  import FilterRenderer2D from './image/filterRenderer2D.js';
11
11
  import './math/p5.Matrix.js';
12
12
  import { PrimitiveToPath2DConverter } from './shape/custom_shapes.js';
@@ -1,6 +1,6 @@
1
1
  import { Vector } from '../p5.Vector.js';
2
2
  import { MatrixInterface } from './MatrixInterface.js';
3
- import '../../constants-DQyACdzq.js';
3
+ import '../../constants-DAnmXDew.js';
4
4
 
5
5
  /**
6
6
  * @module Math
@@ -1,7 +1,7 @@
1
1
  import nj from '@d4c/numjs/build/module/numjs.min.js';
2
2
  import { Vector } from '../p5.Vector.js';
3
3
  import { MatrixInterface } from './MatrixInterface.js';
4
- import '../../constants-DQyACdzq.js';
4
+ import '../../constants-DAnmXDew.js';
5
5
 
6
6
  let isMatrixArray = x => Array.isArray(x);
7
7
  if (typeof Float32Array !== 'undefined') {
@@ -4,7 +4,7 @@ import random from './random.js';
4
4
  import trigonometry from './trigonometry.js';
5
5
  import math$1 from './math.js';
6
6
  import vector from './p5.Vector.js';
7
- import '../constants-DQyACdzq.js';
7
+ import '../constants-DAnmXDew.js';
8
8
 
9
9
  function math(p5){
10
10
  p5.registerAddon(calculation);
@@ -1,6 +1,6 @@
1
1
  import { Matrix } from './Matrices/Matrix.js';
2
2
  import './p5.Vector.js';
3
- import '../constants-DQyACdzq.js';
3
+ import '../constants-DAnmXDew.js';
4
4
  import './Matrices/MatrixInterface.js';
5
5
 
6
6
  /**
@@ -1,4 +1,4 @@
1
- import { q as TWO_PI } from '../constants-DQyACdzq.js';
1
+ import { q as TWO_PI } from '../constants-DAnmXDew.js';
2
2
 
3
3
  /**
4
4
  * @module Math
@@ -1,4 +1,4 @@
1
- import { a5 as RAD_TO_DEG, a6 as DEG_TO_RAD } from '../constants-DQyACdzq.js';
1
+ import { a5 as RAD_TO_DEG, a6 as DEG_TO_RAD } from '../constants-DAnmXDew.js';
2
2
 
3
3
  /**
4
4
  * @module Math
@@ -1,5 +1,5 @@
1
- import { C as Color } from './creating_reading-ZXzcZEsb.js';
2
- import { a2 as NORMAL, aA as WORD, ax as BASELINE, av as LEFT, v as CENTER, p as CORNER, J as INCLUDE } from './constants-DQyACdzq.js';
1
+ import { C as Color } from './creating_reading-C7hu6sg1.js';
2
+ import { a2 as NORMAL, aA as WORD, ax as BASELINE, av as LEFT, v as CENTER, p as CORNER, J as INCLUDE } from './constants-DAnmXDew.js';
3
3
  import Filters from './image/filters.js';
4
4
  import { Vector } from './math/p5.Vector.js';
5
5
  import { Shape } from './shape/custom_shapes.js';
@@ -1,7 +1,7 @@
1
- import { p as CORNER, t as CORNERS, v as CENTER, aB as COVER, aC as CONTAIN, a9 as RIGHT, aw as BOTTOM, B as BLEND, aD as FILL, ad as IMAGE, C as CLAMP, w as ROUND, Y as LINES, X as POINTS, c as TRIANGLES, ab as BLUR, D as DARKEST, L as LIGHTEST, A as ADD, S as SUBTRACT, a as SCREEN, E as EXCLUSION, R as REPLACE, M as MULTIPLY, b as REMOVE, as as BURN, ao as OVERLAY, ap as HARD_LIGHT, aq as SOFT_LIGHT, ar as DODGE, d as UNSIGNED_INT, U as UNSIGNED_BYTE, av as LEFT, ax as BASELINE, ay as TOP, aE as SIMPLE, aF as FULL, q as TWO_PI, Q as OPEN, a2 as NORMAL, V as CLOSE, at as PIE, au as CHORD, h as TEXTURE, P as P2D, g as LINEAR, aa as WEBGL2, N as NEAREST, aG as LINEAR_MIPMAP, f as REPEAT, e as MIRROR, F as FLOAT, ac as WEBGL, H as HALF_FLOAT } from './constants-DQyACdzq.js';
2
- import { C as Color, c as creatingReading, h as RGBA, R as RGB } from './creating_reading-ZXzcZEsb.js';
1
+ import { p as CORNER, t as CORNERS, v as CENTER, aB as COVER, aC as CONTAIN, a9 as RIGHT, aw as BOTTOM, B as BLEND, aD as FILL, ad as IMAGE, C as CLAMP, w as ROUND, Y as LINES, X as POINTS, c as TRIANGLES, ab as BLUR, D as DARKEST, L as LIGHTEST, A as ADD, S as SUBTRACT, a as SCREEN, E as EXCLUSION, R as REPLACE, M as MULTIPLY, b as REMOVE, as as BURN, ao as OVERLAY, ap as HARD_LIGHT, aq as SOFT_LIGHT, ar as DODGE, d as UNSIGNED_INT, U as UNSIGNED_BYTE, av as LEFT, ax as BASELINE, ay as TOP, aE as SIMPLE, aF as FULL, q as TWO_PI, Q as OPEN, a2 as NORMAL, V as CLOSE, at as PIE, au as CHORD, h as TEXTURE, P as P2D, g as LINEAR, aa as WEBGL2, N as NEAREST, aG as LINEAR_MIPMAP, f as REPEAT, e as MIRROR, F as FLOAT, ac as WEBGL, H as HALF_FLOAT } from './constants-DAnmXDew.js';
2
+ import { C as Color, c as creatingReading, h as RGBA, R as RGB } from './creating_reading-C7hu6sg1.js';
3
3
  import { Element } from './dom/p5.Element.js';
4
- import { R as Renderer, I as Image } from './p5.Renderer-D-5LdCRz.js';
4
+ import { R as Renderer, I as Image } from './p5.Renderer-DOk9UW65.js';
5
5
  import { MediaElement } from './dom/p5.MediaElement.js';
6
6
  import primitives from './shape/2d_primitives.js';
7
7
  import attributes from './shape/attributes.js';
@@ -15104,6 +15104,40 @@ function material(p5, fn) {
15104
15104
  * }
15105
15105
  * ```
15106
15106
  *
15107
+ * We can use the `noise()` function built into strands to generate a color for each pixel. (Again no need here for underlying content for the filter to operate on.) Again we'll animate by passing in an announced uniform variable `time` with `setUniform()`, each frame.
15108
+ *
15109
+ * ```js example
15110
+ * let myFilter;
15111
+ *
15112
+ * function setup() {
15113
+ * createCanvas(100, 100, WEBGL);
15114
+ * myFilter = buildFilterShader(noiseShaderCallback);
15115
+ * describe('Evolving animated cloud-like noise in cyan and magenta');
15116
+ * }
15117
+ *
15118
+ * function noiseShaderCallback() {
15119
+ * let time = uniformFloat();
15120
+ * filterColor.begin();
15121
+ * let coord = filterColor.texCoord;
15122
+ *
15123
+ * //generate a value roughly between 0 and 1
15124
+ * let noiseVal = noise(coord.x, coord.y, time / 2000);
15125
+ *
15126
+ * let result = mix(
15127
+ * [1, 0, 1, 1], // Magenta
15128
+ * [0, 1, 1, 1], // Cyan
15129
+ * noiseVal
15130
+ * );
15131
+ * filterColor.set(result);
15132
+ * filterColor.end();
15133
+ * }
15134
+ *
15135
+ * function draw() {
15136
+ * myFilter.setUniform("time", millis());
15137
+ * filter(myFilter);
15138
+ * }
15139
+ * ```
15140
+ *
15107
15141
  * Like the `modify()` method on shaders,
15108
15142
  * advanced users can also fill in `filterColor` using <a href="https://developer.mozilla.org/en-US/docs/Games/Techniques/3D_on_the_web/GLSL_Shaders" target="_blank">GLSL</a>
15109
15143
  * instead of JavaScript.
@@ -15118,15 +15152,17 @@ function material(p5, fn) {
15118
15152
  * @beta
15119
15153
  * @submodule p5.strands
15120
15154
  * @param {Function} callback A function building a p5.strands shader.
15155
+ * @param {Object} [scope] An optional scope object passed to .modify().
15121
15156
  * @returns {p5.Shader} The material shader
15122
15157
  */
15123
15158
  /**
15124
15159
  * @method buildFilterShader
15125
15160
  * @param {Object} hooks An object specifying p5.strands hooks in GLSL.
15161
+ * @param {Object} [scope] An optional scope object passed to .modify().
15126
15162
  * @returns {p5.Shader} The material shader
15127
15163
  */
15128
- fn.buildFilterShader = function (callback) {
15129
- return this.baseFilterShader().modify(callback);
15164
+ fn.buildFilterShader = function (callback, scope) {
15165
+ return this.baseFilterShader().modify(callback, scope);
15130
15166
  };
15131
15167
 
15132
15168
  /**
@@ -15946,15 +15982,17 @@ function material(p5, fn) {
15946
15982
  * @submodule p5.strands
15947
15983
  * @beta
15948
15984
  * @param {Function} callback A function building a p5.strands shader.
15985
+ * @param {Object} [scope] An optional scope object passed to .modify().
15949
15986
  * @returns {p5.Shader} The material shader.
15950
15987
  */
15951
15988
  /**
15952
15989
  * @method buildMaterialShader
15953
15990
  * @param {Object} hooks An object specifying p5.strands hooks in GLSL.
15991
+ * @param {Object} [scope] An optional scope object passed to .modify().
15954
15992
  * @returns {p5.Shader} The material shader.
15955
15993
  */
15956
- fn.buildMaterialShader = function (cb) {
15957
- return this.baseMaterialShader().modify(cb);
15994
+ fn.buildMaterialShader = function (cb, scope) {
15995
+ return this.baseMaterialShader().modify(cb, scope);
15958
15996
  };
15959
15997
 
15960
15998
  /**
@@ -16053,7 +16091,7 @@ function material(p5, fn) {
16053
16091
  /**
16054
16092
  * Returns the base shader used for filters.
16055
16093
  *
16056
- * Calling <a href="#/p5/buildMaterialShader">`buildFilterShader(shaderFunction)`</a>
16094
+ * Calling <a href="#/p5/buildFilterShader">`buildFilterShader(shaderFunction)`</a>
16057
16095
  * is equivalent to calling `baseFilterShader().modify(shaderFunction)`.
16058
16096
  *
16059
16097
  * Read <a href="#/p5/buildFilterShader">the `buildFilterShader` reference</a> or
@@ -16162,15 +16200,17 @@ function material(p5, fn) {
16162
16200
  * @submodule p5.strands
16163
16201
  * @beta
16164
16202
  * @param {Function} callback A function building a p5.strands shader.
16203
+ * @param {Object} [scope] An optional scope object passed to .modify().
16165
16204
  * @returns {p5.Shader} The normal shader.
16166
16205
  */
16167
16206
  /**
16168
16207
  * @method buildNormalShader
16169
16208
  * @param {Object} hooks An object specifying p5.strands hooks in GLSL.
16209
+ * @param {Object} [scope] An optional scope object passed to .modify().
16170
16210
  * @returns {p5.Shader} The normal shader.
16171
16211
  */
16172
- fn.buildNormalShader = function (cb) {
16173
- return this.baseNormalShader().modify(cb);
16212
+ fn.buildNormalShader = function (cb, scope) {
16213
+ return this.baseNormalShader().modify(cb, scope);
16174
16214
  };
16175
16215
 
16176
16216
  /**
@@ -16326,15 +16366,17 @@ function material(p5, fn) {
16326
16366
  * @submodule p5.strands
16327
16367
  * @beta
16328
16368
  * @param {Function} callback A function building a p5.strands shader.
16369
+ * @param {Object} [scope] An optional scope object passed to .modify().
16329
16370
  * @returns {p5.Shader} The color shader.
16330
16371
  */
16331
16372
  /**
16332
16373
  * @method buildColorShader
16333
16374
  * @param {Object} hooks An object specifying p5.strands hooks in GLSL.
16375
+ * @param {Object} [scope] An optional scope object passed to .modify().
16334
16376
  * @returns {p5.Shader} The color shader.
16335
16377
  */
16336
- fn.buildColorShader = function (cb) {
16337
- return this.baseColorShader().modify(cb);
16378
+ fn.buildColorShader = function (cb, scope) {
16379
+ return this.baseColorShader().modify(cb, scope);
16338
16380
  };
16339
16381
 
16340
16382
  /**
@@ -16581,15 +16623,17 @@ function material(p5, fn) {
16581
16623
  * @submodule p5.strands
16582
16624
  * @beta
16583
16625
  * @param {Function} callback A function building a p5.strands shader.
16626
+ * @param {Object} [scope] An optional scope object passed to .modify().
16584
16627
  * @returns {p5.Shader} The stroke shader.
16585
16628
  */
16586
16629
  /**
16587
16630
  * @method buildStrokeShader
16588
16631
  * @param {Object} hooks An object specifying p5.strands hooks in GLSL.
16632
+ * @param {Object} [scope] An optional scope object passed to .modify().
16589
16633
  * @returns {p5.Shader} The stroke shader.
16590
16634
  */
16591
- fn.buildStrokeShader = function (cb) {
16592
- return this.baseStrokeShader().modify(cb);
16635
+ fn.buildStrokeShader = function (cb, scope) {
16636
+ return this.baseStrokeShader().modify(cb, scope);
16593
16637
  };
16594
16638
 
16595
16639
  /**
@@ -1,4 +1,4 @@
1
- import { p as CORNER, q as TWO_PI, r as HALF_PI, s as PI } from '../constants-DQyACdzq.js';
1
+ import { p as CORNER, q as TWO_PI, r as HALF_PI, s as PI } from '../constants-DAnmXDew.js';
2
2
  import canvas from '../core/helpers.js';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { p as CORNER, t as CORNERS, u as RADIUS, v as CENTER, w as ROUND, x as SQUARE, y as PROJECT, z as BEVEL, I as MITER } from '../constants-DQyACdzq.js';
1
+ import { p as CORNER, t as CORNERS, u as RADIUS, v as CENTER, w as ROUND, x as SQUARE, y as PROJECT, z as BEVEL, I as MITER } from '../constants-DAnmXDew.js';
2
2
 
3
3
  /**
4
4
  * @module Shape
@@ -1,6 +1,6 @@
1
- import { C as Color } from '../creating_reading-ZXzcZEsb.js';
1
+ import { C as Color } from '../creating_reading-C7hu6sg1.js';
2
2
  import { Vector } from '../math/p5.Vector.js';
3
- import { J as INCLUDE, K as PATH, O as EMPTY_PATH, Q as OPEN, V as CLOSE, X as POINTS, Y as LINES, c as TRIANGLES, Z as QUADS, _ as TRIANGLE_FAN, T as TRIANGLE_STRIP, $ as QUAD_STRIP, a0 as EXCLUDE, a1 as JOIN } from '../constants-DQyACdzq.js';
3
+ import { J as INCLUDE, K as PATH, O as EMPTY_PATH, Q as OPEN, V as CLOSE, X as POINTS, Y as LINES, c as TRIANGLES, Z as QUADS, _ as TRIANGLE_FAN, T as TRIANGLE_STRIP, $ as QUAD_STRIP, a0 as EXCLUDE, a1 as JOIN } from '../constants-DAnmXDew.js';
4
4
  import 'colorjs.io/fn';
5
5
  import '../color/color_spaces/hsb.js';
6
6
 
@@ -3,9 +3,9 @@ import attributes from './attributes.js';
3
3
  import curves from './curves.js';
4
4
  import vertex from './vertex.js';
5
5
  import customShapes from './custom_shapes.js';
6
- import '../constants-DQyACdzq.js';
6
+ import '../constants-DAnmXDew.js';
7
7
  import '../core/helpers.js';
8
- import '../creating_reading-ZXzcZEsb.js';
8
+ import '../creating_reading-C7hu6sg1.js';
9
9
  import 'colorjs.io/fn';
10
10
  import '../color/color_spaces/hsb.js';
11
11
  import '../math/p5.Vector.js';
@@ -2,5 +2,5 @@ import './ir_dag.js';
2
2
  import './ir_cfg.js';
3
3
  import './strands_FES.js';
4
4
  import './ir_types.js';
5
- export { d as binaryOpNode, g as constructTypeFromIDs, f as functionCallNode, m as memberAccessNode, p as primitiveConstructorNode, e as scalarLiteralNode, s as statementNode, b as structConstructorNode, a as structInstanceNode, h as swizzleNode, i as swizzleTrap, u as unaryOpNode, v as variableNode } from '../ir_builders-DXNgaB9N.js';
5
+ export { d as binaryOpNode, h as castToFloat, g as constructTypeFromIDs, f as functionCallNode, m as memberAccessNode, p as primitiveConstructorNode, e as scalarLiteralNode, s as statementNode, b as structConstructorNode, a as structInstanceNode, i as swizzleNode, j as swizzleTrap, u as unaryOpNode, v as variableNode } from '../ir_builders-w12-GSxu.js';
6
6
  import './strands_builtins.js';
@@ -8,7 +8,7 @@ import 'acorn';
8
8
  import 'acorn-walk';
9
9
  import 'escodegen';
10
10
  import './strands_FES.js';
11
- import '../ir_builders-DXNgaB9N.js';
11
+ import '../ir_builders-w12-GSxu.js';
12
12
  import './strands_builtins.js';
13
13
  import './strands_conditionals.js';
14
14
  import './strands_phi_utils.js';