p5 2.2.3-rc.0 → 2.2.3

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 (97) hide show
  1. package/README.md +4 -5
  2. package/dist/accessibility/color_namer.js +5 -5
  3. package/dist/accessibility/index.js +5 -5
  4. package/dist/app.js +5 -5
  5. package/dist/color/color_conversion.js +5 -5
  6. package/dist/color/index.js +1 -1
  7. package/dist/color/setting.js +1 -1
  8. package/dist/{constants-D3ryGa0m.js → constants-BdTiYOQI.js} +1 -1
  9. package/dist/core/constants.js +1 -1
  10. package/dist/core/environment.js +1 -1
  11. package/dist/core/filterShaders.js +1 -1
  12. package/dist/core/friendly_errors/fes_core.js +1 -1
  13. package/dist/core/friendly_errors/file_errors.js +1 -1
  14. package/dist/core/friendly_errors/index.js +1 -1
  15. package/dist/core/friendly_errors/param_validator.js +1 -1
  16. package/dist/core/friendly_errors/sketch_verifier.js +1 -1
  17. package/dist/core/helpers.js +1 -1
  18. package/dist/core/init.js +5 -5
  19. package/dist/core/internationalization.js +1 -1
  20. package/dist/core/legacy.js +5 -5
  21. package/dist/core/main.js +5 -5
  22. package/dist/core/p5.Graphics.js +3 -3
  23. package/dist/core/p5.Renderer.js +2 -2
  24. package/dist/core/p5.Renderer2D.js +5 -5
  25. package/dist/core/p5.Renderer3D.js +3 -3
  26. package/dist/core/rendering.js +3 -3
  27. package/dist/data/local_storage.js +13 -9
  28. package/dist/dom/dom.js +30 -29
  29. package/dist/dom/index.js +1 -1
  30. package/dist/dom/p5.Element.js +3 -3
  31. package/dist/dom/p5.MediaElement.js +4 -5
  32. package/dist/events/pointer.js +1 -1
  33. package/dist/image/const.js +1 -1
  34. package/dist/image/filterRenderer2D.js +4 -4
  35. package/dist/image/image.js +3 -3
  36. package/dist/image/index.js +3 -3
  37. package/dist/image/loading_displaying.js +3 -3
  38. package/dist/image/p5.Image.js +2 -2
  39. package/dist/io/files.js +3 -3
  40. package/dist/io/index.js +3 -3
  41. package/dist/io/p5.XML.js +8 -8
  42. package/dist/{ir_builders-DMfaOLIL.js → ir_builders-Cd6rU9Vm.js} +0 -6
  43. package/dist/{main-CGwYa9-f.js → main-H_nu4eDs.js} +3 -3
  44. package/dist/math/Matrices/Matrix.js +1 -1
  45. package/dist/math/Matrices/MatrixNumjs.js +1 -1
  46. package/dist/math/index.js +1 -1
  47. package/dist/math/p5.Matrix.js +1 -1
  48. package/dist/math/p5.Vector.js +1 -1
  49. package/dist/math/trigonometry.js +1 -1
  50. package/dist/{p5.Renderer-C0e0XesC.js → p5.Renderer-BmD2P6Wv.js} +4 -3
  51. package/dist/{rendering-4Z2qdE_W.js → rendering-CC8JNTwG.js} +21 -58
  52. package/dist/shape/2d_primitives.js +1 -1
  53. package/dist/shape/attributes.js +1 -1
  54. package/dist/shape/custom_shapes.js +1 -1
  55. package/dist/shape/index.js +1 -1
  56. package/dist/strands/ir_builders.js +1 -1
  57. package/dist/strands/p5.strands.js +10 -34
  58. package/dist/strands/strands_api.js +1 -2
  59. package/dist/strands/strands_codegen.js +0 -12
  60. package/dist/strands/strands_conditionals.js +1 -1
  61. package/dist/strands/strands_for.js +1 -1
  62. package/dist/strands/strands_node.js +1 -1
  63. package/dist/type/index.js +2 -2
  64. package/dist/type/p5.Font.js +2 -2
  65. package/dist/type/textCore.js +2 -2
  66. package/dist/webgl/3d_primitives.js +3 -3
  67. package/dist/webgl/GeometryBuilder.js +1 -1
  68. package/dist/webgl/ShapeBuilder.js +1 -1
  69. package/dist/webgl/enums.js +1 -1
  70. package/dist/webgl/index.js +4 -4
  71. package/dist/webgl/interaction.js +1 -1
  72. package/dist/webgl/light.js +3 -3
  73. package/dist/webgl/loading.js +4 -6
  74. package/dist/webgl/material.js +3 -3
  75. package/dist/webgl/p5.Camera.js +3 -3
  76. package/dist/webgl/p5.Framebuffer.js +3 -3
  77. package/dist/webgl/p5.Geometry.js +1 -1
  78. package/dist/webgl/p5.Quat.js +1 -1
  79. package/dist/webgl/p5.RendererGL.js +4 -4
  80. package/dist/webgl/p5.Shader.js +14 -6
  81. package/dist/webgl/p5.Texture.js +3 -3
  82. package/dist/webgl/strands_glslBackend.js +1 -1
  83. package/dist/webgl/text.js +3 -3
  84. package/dist/webgl/utils.js +3 -3
  85. package/dist/webgpu/index.js +2 -2
  86. package/dist/webgpu/p5.RendererWebGPU.js +2 -2
  87. package/dist/webgpu/strands_wgslBackend.js +1 -1
  88. package/lib/p5.esm.js +104 -173
  89. package/lib/p5.esm.min.js +1 -1
  90. package/lib/p5.js +104 -173
  91. package/lib/p5.min.js +1 -1
  92. package/lib/p5.webgpu.esm.js +1 -7
  93. package/lib/p5.webgpu.js +1 -7
  94. package/lib/p5.webgpu.min.js +1 -1
  95. package/package.json +1 -1
  96. package/types/global.d.ts +1170 -1210
  97. package/types/p5.d.ts +645 -658
package/lib/p5.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! p5.js v2.2.3-rc.0 March 10, 2026 */
1
+ /*! p5.js v2.2.3 March 21, 2026 */
2
2
  var p5 = (function () {
3
3
  'use strict';
4
4
 
@@ -15,7 +15,7 @@ var p5 = (function () {
15
15
  * @property {String} VERSION
16
16
  * @final
17
17
  */
18
- const VERSION = '2.2.3-rc.0';
18
+ const VERSION = '2.2.3';
19
19
 
20
20
  // GRAPHICS RENDERER
21
21
  /**
@@ -12791,7 +12791,7 @@ var p5 = (function () {
12791
12791
  * Returns the element's name as a `String`.
12792
12792
  *
12793
12793
  * An XML element's name is given by its tag. For example, the element
12794
- * `<language>JavaScript</language>` has the name `language`.
12794
+ * `<language>JavaScript</language>` has the name `language`.
12795
12795
  *
12796
12796
  * @return {String} name of the element.
12797
12797
  *
@@ -12834,11 +12834,11 @@ var p5 = (function () {
12834
12834
  * Sets the element's tag name.
12835
12835
  *
12836
12836
  * An XML element's name is given by its tag. For example, the element
12837
- * `&lt;language&gt;JavaScript&lt;/language&gt;` has the name `language`.
12837
+ * `<language>JavaScript</language>` has the name `language`.
12838
12838
  *
12839
12839
  * The parameter, `name`, is the element's new name as a string. For example,
12840
12840
  * calling `myXML.setName('planet')` will make the element's new tag name
12841
- * `&lt;planet&gt;&lt;/planet&gt;`.
12841
+ * `<planet></planet>`.
12842
12842
  *
12843
12843
  * @param {String} name new tag name of the element.
12844
12844
  *
@@ -12980,7 +12980,7 @@ var p5 = (function () {
12980
12980
  *
12981
12981
  * The parameter, `name`, is optional. If a string is passed, as in
12982
12982
  * `myXML.getChildren('cat')`, then the method will only return child elements
12983
- * with the tag `&lt;cat&gt;`.
12983
+ * with the tag `<cat>`.
12984
12984
  *
12985
12985
  * @param {String} [name] name of the elements to return.
12986
12986
  * @return {p5.XML[]} child elements.
@@ -13074,7 +13074,7 @@ var p5 = (function () {
13074
13074
  *
13075
13075
  * The parameter, `name`, is optional. If a string is passed, as in
13076
13076
  * `myXML.getChild('cat')`, then the first child element with the tag
13077
- * `&lt;cat&gt;` will be returned. If a number is passed, as in
13077
+ * `<cat>` will be returned. If a number is passed, as in
13078
13078
  * `myXML.getChild(1)`, then the child element at that index will be returned.
13079
13079
  *
13080
13080
  * @param {String|Integer} name element name or index.
@@ -13207,7 +13207,7 @@ var p5 = (function () {
13207
13207
  *
13208
13208
  * The parameter, `name`, is the child element to remove. If a string is
13209
13209
  * passed, as in `myXML.removeChild('cat')`, then the first child element
13210
- * with the tag `&lt;cat&gt;` will be removed. If a number is passed, as in
13210
+ * with the tag `<cat>` will be removed. If a number is passed, as in
13211
13211
  * `myXML.removeChild(1)`, then the child element at that index will be
13212
13212
  * removed.
13213
13213
  *
@@ -13761,7 +13761,7 @@ var p5 = (function () {
13761
13761
  * Sets the element's content.
13762
13762
  *
13763
13763
  * An element's content is the text between its tags. For example, the element
13764
- * `&lt;language&gt;JavaScript&lt;/language&gt;` has the content `JavaScript`.
13764
+ * `<language>JavaScript</language>` has the content `JavaScript`.
13765
13765
  *
13766
13766
  * The parameter, `content`, is a string with the element's new content.
13767
13767
  *
@@ -13879,7 +13879,7 @@ var p5 = (function () {
13879
13879
  * (<a href="https://developer.mozilla.org/en-US/docs/Web/XML/XML_introduction" target="_blank">XML</a>)
13880
13880
  * is a standard format for sending data between applications. Like HTML, the
13881
13881
  * XML format is based on tags and attributes, as in
13882
- * `&lt;time units="s"&gt;1234&lt;/time&gt;`.
13882
+ * `<time units="s">1234</time>`.
13883
13883
  *
13884
13884
  * Note: Use <a href="#/p5/loadXML">loadXML()</a> to load external XML files.
13885
13885
  *
@@ -14373,9 +14373,9 @@ var p5 = (function () {
14373
14373
  /**
14374
14374
  * Attaches the element to a parent element.
14375
14375
  *
14376
- * For example, a `&lt;div&gt;&lt;/div&gt;` element may be used as a box to
14376
+ * For example, a `<div></div>` element may be used as a box to
14377
14377
  * hold two pieces of text, a header and a paragraph. The
14378
- * `&lt;div&gt;&lt;/div&gt;` is the parent element of both the header and
14378
+ * `<div></div>` is the parent element of both the header and
14379
14379
  * paragraph.
14380
14380
  *
14381
14381
  * The parameter `parent` can have one of three types. `parent` can be a
@@ -18946,8 +18946,9 @@ var p5 = (function () {
18946
18946
  props.displayIndex = index;
18947
18947
  this.drawingContext.putImageData(props.frames[index].image, 0, 0);
18948
18948
  } else {
18949
- console.log(
18950
- 'Cannot set GIF to a frame number that is higher than total number of frames or below zero.'
18949
+ p5._friendlyError(
18950
+ 'Cannot set GIF to a frame number that is higher than total number of frames or below zero.',
18951
+ 'setFrame'
18951
18952
  );
18952
18953
  }
18953
18954
  }
@@ -27693,7 +27694,6 @@ var p5 = (function () {
27693
27694
  removeCue(id) {
27694
27695
  for (let i = 0; i < this._cues.length; i++) {
27695
27696
  if (this._cues[i].id === id) {
27696
- console.log(id);
27697
27697
  this._cues.splice(i, 1);
27698
27698
  }
27699
27699
  }
@@ -27843,7 +27843,7 @@ var p5 = (function () {
27843
27843
  }
27844
27844
 
27845
27845
  /**
27846
- * Creates a `&lt;video&gt;` element for simple audio/video playback.
27846
+ * Creates a `<video>` element for simple audio/video playback.
27847
27847
  *
27848
27848
  * `createVideo()` returns a new
27849
27849
  * <a href="#/p5.MediaElement">p5.MediaElement</a> object. Videos are shown by
@@ -27931,7 +27931,7 @@ var p5 = (function () {
27931
27931
  /* AUDIO STUFF */
27932
27932
 
27933
27933
  /**
27934
- * Creates a hidden `&lt;audio&gt;` element for simple audio playback.
27934
+ * Creates a hidden `<audio>` element for simple audio playback.
27935
27935
  *
27936
27936
  * `createAudio()` returns a new
27937
27937
  * <a href="#/p5.MediaElement">p5.MediaElement</a> object.
@@ -28008,7 +28008,7 @@ var p5 = (function () {
28008
28008
  }
28009
28009
 
28010
28010
  /**
28011
- * Creates a `&lt;video&gt;` element that "captures" the audio/video stream from
28011
+ * Creates a `<video>` element that "captures" the audio/video stream from
28012
28012
  * the webcam and microphone.
28013
28013
  *
28014
28014
  * `createCapture()` returns a new
@@ -36810,7 +36810,7 @@ var p5 = (function () {
36810
36810
  * (<a href="https://developer.mozilla.org/en-US/docs/Web/XML/XML_introduction" target="_blank">XML</a>)
36811
36811
  * is a standard format for sending data between applications. Like HTML, the
36812
36812
  * XML format is based on tags and attributes, as in
36813
- * `&lt;time units="s"&gt;1234&lt;/time&gt;`.
36813
+ * `<time units="s">1234</time>`.
36814
36814
  *
36815
36815
  * The first parameter, `path`, is always a string with the path to the file.
36816
36816
  * Paths to local files should be relative, as in
@@ -55127,11 +55127,6 @@ var p5 = (function () {
55127
55127
  * The parameter, `callback`, is a function with the drawing instructions for
55128
55128
  * the new <a href="#/p5.Geometry">p5.Geometry</a> object. It will be called
55129
55129
  * once to create the new 3D shape.
55130
- *
55131
- * See <a href="#/p5/beginGeometry">beginGeometry()</a> and
55132
- * <a href="#/p5/endGeometry">endGeometry()</a> for another way to build 3D
55133
- * shapes.
55134
- *
55135
55130
  * Note: `buildGeometry()` can only be used in WebGL mode.
55136
55131
  *
55137
55132
  * @method buildGeometry
@@ -55335,12 +55330,8 @@ var p5 = (function () {
55335
55330
  * <a href="#/p5.Geometry">p5.Geometry</a> objects can contain lots of data
55336
55331
  * about their vertices, surface normals, colors, and so on. Complex 3D shapes
55337
55332
  * can use lots of memory which is a limited resource in many GPUs. Calling
55338
- * `freeGeometry()` can improve performance by freeing a
55339
- * <a href="#/p5.Geometry">p5.Geometry</a> object’s resources from GPU memory.
55340
55333
  * `freeGeometry()` works with <a href="#/p5.Geometry">p5.Geometry</a> objects
55341
- * created with <a href="#/p5/beginGeometry">beginGeometry()</a> and
55342
- * <a href="#/p5/endGeometry">endGeometry()</a>,
55343
- * <a href="#/p5/buildGeometry">buildGeometry()</a>, and
55334
+ * created with <a href="#/p5/buildGeometry">buildGeometry()</a> and
55344
55335
  * <a href="#/p5/loadModel">loadModel()</a>.
55345
55336
  *
55346
55337
  * The parameter, `geometry`, is the <a href="#/p5.Geometry">p5.Geometry</a>
@@ -55356,24 +55347,6 @@ var p5 = (function () {
55356
55347
  * @param {p5.Geometry} geometry 3D shape whose resources should be freed.
55357
55348
  *
55358
55349
  * @example
55359
- * function setup() {
55360
- * createCanvas(100, 100, WEBGL);
55361
- *
55362
- * background(200);
55363
- *
55364
- * // Create a p5.Geometry object.
55365
- * beginGeometry();
55366
- * cone();
55367
- * let shape = endGeometry();
55368
- *
55369
- * // Draw the shape.
55370
- * model(shape);
55371
- *
55372
- * // Free the shape's resources.
55373
- * freeGeometry(shape);
55374
- * }
55375
- *
55376
- * @example
55377
55350
  * // Click and drag the mouse to view the scene from different angles.
55378
55351
  *
55379
55352
  * let button;
@@ -59610,24 +59583,28 @@ var p5 = (function () {
59610
59583
  *
59611
59584
  * In addition to calling hooks, you can create uniforms, which are special variables
59612
59585
  * used to pass data from p5.js into the shader. They can be created by calling `uniform` + the
59613
- * type of the data, such as `uniformFloat` for a number of `uniformVector2` for a two-component vector.
59586
+ * type of the data, such as `uniformFloat` for a number or `uniformVector2` for a two-component vector.
59614
59587
  * They take in a function that returns the data for the variable. You can then reference these
59615
59588
  * variables in your hooks, and their values will update every time you apply
59616
- * the shader with the result of your function.
59589
+ * the shader with the result of your function.
59590
+ *
59591
+ * Move the mouse over this sketch to increase the moveCounter which will be passed to the shader as a uniform.
59617
59592
  *
59618
59593
  * ```js example
59619
59594
  * let myShader;
59620
- *
59595
+ * //count of frames in which mouse has been moved
59596
+ * let moveCounter = 0;
59597
+ *
59621
59598
  * function setup() {
59622
59599
  * createCanvas(200, 200, WEBGL);
59623
59600
  * myShader = baseMaterialShader().modify(() => {
59624
- * // Get the current time from p5.js
59625
- * let t = uniformFloat(() => millis());
59601
+ * // Get the move counter from our sketch
59602
+ * let count = uniformFloat(() => moveCounter);
59626
59603
  *
59627
59604
  * getPixelInputs((inputs) => {
59628
59605
  * inputs.color = [
59629
59606
  * inputs.texCoord,
59630
- * sin(t * 0.01) / 2 + 0.5,
59607
+ * sin(count/100) / 2 + 0.5,
59631
59608
  * 1,
59632
59609
  * ];
59633
59610
  * return inputs;
@@ -59635,6 +59612,10 @@ var p5 = (function () {
59635
59612
  * });
59636
59613
  * }
59637
59614
  *
59615
+ * function mouseDragged(){
59616
+ * moveCounter += 1;
59617
+ * }
59618
+ *
59638
59619
  * function draw() {
59639
59620
  * background(255);
59640
59621
  * noStroke(255);
@@ -61013,7 +60994,7 @@ var p5 = (function () {
61013
60994
  * // Make a version of the shader with a hook overridden
61014
60995
  * modifiedShader = myShader.modify(() => {
61015
60996
  * // Create new uniforms and override the getColor hook
61016
- * let t = uniformFloat(() => millis() / 1000);
60997
+ * let t = millis() / 1000;
61017
60998
  * getColor(() => {
61018
60999
  * return [0, 0.5 + 0.5 * sin(t), 1, 1];
61019
61000
  * });
@@ -61259,7 +61240,7 @@ var p5 = (function () {
61259
61240
  * }
61260
61241
  * ```
61261
61242
  *
61262
- * You can also animate your filters over time by passing the time into the shader with `uniformFloat`.
61243
+ * You can also animate your filters over time using the `millis()` function.
61263
61244
  *
61264
61245
  * ```js example
61265
61246
  * let myFilter;
@@ -61270,7 +61251,7 @@ var p5 = (function () {
61270
61251
  * }
61271
61252
  *
61272
61253
  * function gradient() {
61273
- * let time = uniformFloat();
61254
+ * let time = millis();
61274
61255
  * filterColor.begin();
61275
61256
  * filterColor.set(mix(
61276
61257
  * [1, 0, 0, 1], // Red
@@ -61281,12 +61262,11 @@ var p5 = (function () {
61281
61262
  * }
61282
61263
  *
61283
61264
  * function draw() {
61284
- * myFilter.setUniform('time', millis());
61285
61265
  * filter(myFilter);
61286
61266
  * }
61287
61267
  * ```
61288
61268
  *
61289
- * 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.
61269
+ * 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 using the millis() function to get an up-to-date time value.
61290
61270
  *
61291
61271
  * ```js example
61292
61272
  * let myFilter;
@@ -61298,7 +61278,7 @@ var p5 = (function () {
61298
61278
  * }
61299
61279
  *
61300
61280
  * function noiseShaderCallback() {
61301
- * let time = uniformFloat();
61281
+ * let time = millis();
61302
61282
  * filterColor.begin();
61303
61283
  * let coord = filterColor.texCoord;
61304
61284
  *
@@ -61315,7 +61295,6 @@ var p5 = (function () {
61315
61295
  * }
61316
61296
  *
61317
61297
  * function draw() {
61318
- * myFilter.setUniform("time", millis());
61319
61298
  * filter(myFilter);
61320
61299
  * }
61321
61300
  * ```
@@ -61529,7 +61508,7 @@ var p5 = (function () {
61529
61508
  * }
61530
61509
  *
61531
61510
  * function material() {
61532
- * let time = uniformFloat();
61511
+ * let time = millis() / 1000;
61533
61512
  * finalColor.begin();
61534
61513
  * let r = 0.2 + 0.5 * abs(sin(time + 0));
61535
61514
  * let g = 0.2 + 0.5 * abs(sin(time + 1));
@@ -61540,7 +61519,6 @@ var p5 = (function () {
61540
61519
  *
61541
61520
  * function draw() {
61542
61521
  * background(245, 245, 220);
61543
- * myShader.setUniform('time', millis() / 1000);
61544
61522
  * shader(myShader);
61545
61523
  *
61546
61524
  * rectMode(CENTER);
@@ -62016,7 +61994,7 @@ var p5 = (function () {
62016
61994
  * }
62017
61995
  *
62018
61996
  * function material() {
62019
- * let time = uniformFloat();
61997
+ * let time = millis();
62020
61998
  * worldInputs.begin();
62021
61999
  * worldInputs.position.y +=
62022
62000
  * 20 * sin(time * 0.001 + worldInputs.position.x * 0.05);
@@ -62026,7 +62004,6 @@ var p5 = (function () {
62026
62004
  * function draw() {
62027
62005
  * background(255);
62028
62006
  * shader(myShader);
62029
- * myShader.setUniform('time', millis());
62030
62007
  * lights();
62031
62008
  * noStroke();
62032
62009
  * fill('red');
@@ -62195,7 +62172,6 @@ var p5 = (function () {
62195
62172
  * function draw() {
62196
62173
  * background(255);
62197
62174
  * shader(myShader);
62198
- * myShader.setUniform('time', millis());
62199
62175
  * lights();
62200
62176
  * noStroke();
62201
62177
  * fill('red');
@@ -62209,7 +62185,7 @@ var p5 = (function () {
62209
62185
  *
62210
62186
  * ```js
62211
62187
  * // myMaterial.js
62212
- * let time = uniformFloat();
62188
+ * let time = millis();
62213
62189
  * worldInputs.begin();
62214
62190
  * worldInputs.position.y +=
62215
62191
  * 20 * sin(time * 0.001 + worldInputs.position.x * 0.05);
@@ -62318,7 +62294,7 @@ var p5 = (function () {
62318
62294
  * }
62319
62295
  *
62320
62296
  * function material() {
62321
- * let time = uniformFloat();
62297
+ * let time = millis();
62322
62298
  * worldInputs.begin();
62323
62299
  * worldInputs.position.y +=
62324
62300
  * 20. * sin(time * 0.001 + worldInputs.position.x * 0.05);
@@ -62328,7 +62304,6 @@ var p5 = (function () {
62328
62304
  * function draw() {
62329
62305
  * background(255);
62330
62306
  * shader(myShader);
62331
- * myShader.setUniform('time', millis());
62332
62307
  * noStroke();
62333
62308
  * sphere(50);
62334
62309
  * }
@@ -62414,7 +62389,6 @@ var p5 = (function () {
62414
62389
  * function draw() {
62415
62390
  * background(255);
62416
62391
  * shader(myShader);
62417
- * myShader.setUniform('time', millis());
62418
62392
  * lights();
62419
62393
  * noStroke();
62420
62394
  * fill('red');
@@ -62428,7 +62402,7 @@ var p5 = (function () {
62428
62402
  *
62429
62403
  * ```js
62430
62404
  * // myMaterial.js
62431
- * let time = uniformFloat();
62405
+ * let time = millis();
62432
62406
  * worldInputs.begin();
62433
62407
  * worldInputs.position.y +=
62434
62408
  * 20 * sin(time * 0.001 + worldInputs.position.x * 0.05);
@@ -62521,7 +62495,7 @@ var p5 = (function () {
62521
62495
  * }
62522
62496
  *
62523
62497
  * function material() {
62524
- * let time = uniformFloat();
62498
+ * let time = millis();
62525
62499
  * worldInputs.begin();
62526
62500
  * worldInputs.position.y +=
62527
62501
  * 20 * sin(time * 0.001 + worldInputs.position.x * 0.05);
@@ -62531,7 +62505,6 @@ var p5 = (function () {
62531
62505
  * function draw() {
62532
62506
  * background(255);
62533
62507
  * shader(myShader);
62534
- * myShader.setUniform('time', millis());
62535
62508
  * noStroke();
62536
62509
  * fill('red');
62537
62510
  * circle(0, 0, 50);
@@ -62580,7 +62553,6 @@ var p5 = (function () {
62580
62553
  * function draw() {
62581
62554
  * background(255);
62582
62555
  * shader(myShader);
62583
- * myShader.setUniform('time', millis());
62584
62556
  * lights();
62585
62557
  * noStroke();
62586
62558
  * fill('red');
@@ -62594,7 +62566,7 @@ var p5 = (function () {
62594
62566
  *
62595
62567
  * ```js
62596
62568
  * // myMaterial.js
62597
- * let time = uniformFloat();
62569
+ * let time = millis();
62598
62570
  * worldInputs.begin();
62599
62571
  * worldInputs.position.y +=
62600
62572
  * 20 * sin(time * 0.001 + worldInputs.position.x * 0.05);
@@ -62766,7 +62738,7 @@ var p5 = (function () {
62766
62738
  * }
62767
62739
  *
62768
62740
  * function material() {
62769
- * let time = uniformFloat();
62741
+ * let time = millis();
62770
62742
  * worldInputs.begin();
62771
62743
  * // Add a somewhat random offset to the weight
62772
62744
  * // that varies based on position and time
@@ -62782,7 +62754,6 @@ var p5 = (function () {
62782
62754
  * function draw() {
62783
62755
  * background(255);
62784
62756
  * strokeShader(myShader);
62785
- * myShader.setUniform('time', millis());
62786
62757
  * strokeWeight(10);
62787
62758
  * beginShape();
62788
62759
  * for (let i = 0; i <= 50; i++) {
@@ -65479,7 +65450,7 @@ var p5 = (function () {
65479
65450
  * Removes the graphics buffer from the web page.
65480
65451
  *
65481
65452
  * Calling `myGraphics.remove()` removes the graphics buffer's
65482
- * `&lt;canvas&gt;` element from the web page. The graphics buffer also uses
65453
+ * `<canvas>` element from the web page. The graphics buffer also uses
65483
65454
  * a bit of memory on the CPU that can be freed like so:
65484
65455
  *
65485
65456
  * ```js
@@ -65835,7 +65806,7 @@ var p5 = (function () {
65835
65806
  * @param {Number} h height height of the graphics buffer in pixels.
65836
65807
  * @param {(P2D|WEBGL|P2DHDR)} renderer the renderer to use, either P2D or WEBGL.
65837
65808
  * @param {p5} [pInst] sketch instance.
65838
- * @param {HTMLCanvasElement} [canvas] existing `&lt;canvas&gt;` element to use.
65809
+ * @param {HTMLCanvasElement} [canvas] existing `<canvas>` element to use.
65839
65810
  *
65840
65811
  * @example
65841
65812
  * let pg;
@@ -68814,9 +68785,9 @@ var p5 = (function () {
68814
68785
 
68815
68786
  /**
68816
68787
  * A system variable that provides direct access to the sketch's
68817
- * `&lt;canvas&gt;` element.
68788
+ * `<canvas>` element.
68818
68789
  *
68819
- * The `&lt;canvas&gt;` element provides many specialized features that aren't
68790
+ * The `<canvas>` element provides many specialized features that aren't
68820
68791
  * included in the p5.js library. The `drawingContext` system variable
68821
68792
  * provides access to these features by exposing the sketch's
68822
68793
  * <a href="https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D">CanvasRenderingContext2D</a>
@@ -69367,9 +69338,6 @@ var p5 = (function () {
69367
69338
  const assignmentID = getOrCreateNode(dag, assignmentNode);
69368
69339
  recordInBasicBlock(cfg, cfg.currentBlock, assignmentID);
69369
69340
 
69370
- // Track for global assignments processing
69371
- this.strandsContext.globalAssignments.push(assignmentID);
69372
-
69373
69341
  // Simply update this node to be a variable node with the identifier
69374
69342
  // This ensures it always generates the variable name in expressions
69375
69343
  const variableNodeData = createNodeData({
@@ -69433,9 +69401,6 @@ var p5 = (function () {
69433
69401
  const assignmentID = getOrCreateNode(dag, assignmentNode);
69434
69402
  recordInBasicBlock(cfg, cfg.currentBlock, assignmentID);
69435
69403
 
69436
- // Track for global assignments processing in the current hook context
69437
- this.strandsContext.globalAssignments.push(assignmentID);
69438
-
69439
69404
  // Simply update this node to be a variable node with the identifier
69440
69405
  // This ensures it always generates the variable name in expressions
69441
69406
  const variableNodeData = createNodeData({
@@ -97305,18 +97270,20 @@ var p5 = (function () {
97305
97270
  */
97306
97271
  fn.storeItem = function(key, value) {
97307
97272
  if (typeof key !== 'string') {
97308
- console.log(
97309
- `The argument that you passed to storeItem() - ${key} is not a string.`
97273
+ p5._friendlyError(
97274
+ `The argument that you passed to storeItem() - ${key} is not a string.`,
97275
+ 'storeItem'
97310
97276
  );
97311
97277
  }
97312
97278
  if (key.endsWith('p5TypeID')) {
97313
- console.log(
97314
- `The argument that you passed to storeItem() - ${key} must not end with 'p5TypeID'.`
97279
+ p5._friendlyError(
97280
+ `The argument that you passed to storeItem() - ${key} must not end with 'p5TypeID'.`,
97281
+ 'storeItem'
97315
97282
  );
97316
97283
  }
97317
97284
 
97318
97285
  if (typeof value === 'undefined') {
97319
- console.log('You cannot store undefined variables using storeItem().');
97286
+ p5._friendlyError('You cannot store undefined variables using storeItem().', 'storeItem');
97320
97287
  }
97321
97288
  let type = typeof value;
97322
97289
  switch (type) {
@@ -97451,8 +97418,9 @@ var p5 = (function () {
97451
97418
  let value = localStorage.getItem(key);
97452
97419
  const type = localStorage.getItem(`${key}p5TypeID`);
97453
97420
  if (typeof type === 'undefined') {
97454
- console.log(
97455
- `Unable to determine type of item stored under ${key}in local storage. Did you save the item with something other than setItem()?`
97421
+ p5._friendlyError(
97422
+ `Unable to determine type of item stored under ${key}in local storage. Did you save the item with something other than setItem()?`,
97423
+ 'getItem'
97456
97424
  );
97457
97425
  } else if (value !== null) {
97458
97426
  switch (type) {
@@ -97603,8 +97571,9 @@ var p5 = (function () {
97603
97571
  */
97604
97572
  fn.removeItem = function(key) {
97605
97573
  if (typeof key !== 'string') {
97606
- console.log(
97607
- `The argument that you passed to removeItem() - ${key} is not a string.`
97574
+ p5._friendlyError(
97575
+ `The argument that you passed to removeItem() - ${key} is not a string.`,
97576
+ 'removeItem'
97608
97577
  );
97609
97578
  }
97610
97579
  localStorage.removeItem(key);
@@ -97990,16 +97959,16 @@ var p5 = (function () {
97990
97959
  }
97991
97960
 
97992
97961
  /**
97993
- * Creates a `&lt;div&gt;&lt;/div&gt;` element.
97962
+ * Creates a `<div></div>` element.
97994
97963
  *
97995
- * `&lt;div&gt;&lt;/div&gt;` elements are commonly used as containers for
97964
+ * `<div></div>` elements are commonly used as containers for
97996
97965
  * other elements.
97997
97966
  *
97998
97967
  * The parameter `html` is optional. It accepts a string that sets the
97999
- * inner HTML of the new `&lt;div&gt;&lt;/div&gt;`.
97968
+ * inner HTML of the new `<div></div>`.
98000
97969
  *
98001
97970
  * @method createDiv
98002
- * @param {String} [html] inner HTML for the new `&lt;div&gt;&lt;/div&gt;` element.
97971
+ * @param {String} [html] inner HTML for the new `<div></div>` element.
98003
97972
  * @return {p5.Element} new <a href="#/p5.Element">p5.Element</a> object.
98004
97973
  *
98005
97974
  * @example
@@ -98037,13 +98006,13 @@ var p5 = (function () {
98037
98006
  /**
98038
98007
  * Creates a paragraph element.
98039
98008
  *
98040
- * `&lt;p&gt;&lt;/p&gt;` elements are commonly used for paragraph-length text.
98009
+ * `<p></p>` elements are commonly used for paragraph-length text.
98041
98010
  *
98042
98011
  * The parameter `html` is optional. It accepts a string that sets the
98043
- * inner HTML of the new `&lt;p&gt;&lt;/p&gt;`.
98012
+ * inner HTML of the new `<p></p>`.
98044
98013
  *
98045
98014
  * @method createP
98046
- * @param {String} [html] inner HTML for the new `&lt;p&gt;&lt;/p&gt;` element.
98015
+ * @param {String} [html] inner HTML for the new `<p></p>` element.
98047
98016
  * @return {p5.Element} new <a href="#/p5.Element">p5.Element</a> object.
98048
98017
  *
98049
98018
  * @example
@@ -98066,18 +98035,18 @@ var p5 = (function () {
98066
98035
  };
98067
98036
 
98068
98037
  /**
98069
- * Creates a `&lt;span&gt;&lt;/span&gt;` element.
98038
+ * Creates a `<span></span>` element.
98070
98039
  *
98071
- * `&lt;span&gt;&lt;/span&gt;` elements are commonly used as containers
98072
- * for inline elements. For example, a `&lt;span&gt;&lt;/span&gt;`
98040
+ * `<span></span>` elements are commonly used as containers
98041
+ * for inline elements. For example, a `<span></span>`
98073
98042
  * can hold part of a sentence that's a
98074
98043
  * <span style="color: deeppink;">different</span> style.
98075
98044
  *
98076
98045
  * The parameter `html` is optional. It accepts a string that sets the
98077
- * inner HTML of the new `&lt;span&gt;&lt;/span&gt;`.
98046
+ * inner HTML of the new `<span></span>`.
98078
98047
  *
98079
98048
  * @method createSpan
98080
- * @param {String} [html] inner HTML for the new `&lt;span&gt;&lt;/span&gt;` element.
98049
+ * @param {String} [html] inner HTML for the new `<span></span>` element.
98081
98050
  * @return {p5.Element} new <a href="#/p5.Element">p5.Element</a> object.
98082
98051
  *
98083
98052
  * @example
@@ -98130,7 +98099,7 @@ var p5 = (function () {
98130
98099
  };
98131
98100
 
98132
98101
  /**
98133
- * Creates an `&lt;img&gt;` element that can appear outside of the canvas.
98102
+ * Creates an `<img>` element that can appear outside of the canvas.
98134
98103
  *
98135
98104
  * The first parameter, `src`, is a string with the path to the image file.
98136
98105
  * `src` should be a relative path, as in `'assets/image.png'`, or a URL, as
@@ -98201,7 +98170,7 @@ var p5 = (function () {
98201
98170
  };
98202
98171
 
98203
98172
  /**
98204
- * Creates an `&lt;a&gt;&lt;/a&gt;` element that links to another web page.
98173
+ * Creates an `<a></a>` element that links to another web page.
98205
98174
  *
98206
98175
  * The first parmeter, `href`, is a string that sets the URL of the linked
98207
98176
  * page.
@@ -98258,7 +98227,7 @@ var p5 = (function () {
98258
98227
 
98259
98228
  /* INPUT */
98260
98229
  /**
98261
- * Creates a slider `&lt;input&gt;&lt;/input&gt;` element.
98230
+ * Creates a slider `<input></input>` element.
98262
98231
  *
98263
98232
  * Range sliders are useful for quickly selecting numbers from a given range.
98264
98233
  *
@@ -98380,7 +98349,7 @@ var p5 = (function () {
98380
98349
  };
98381
98350
 
98382
98351
  /**
98383
- * Creates a `&lt;button&gt;&lt;/button&gt;` element.
98352
+ * Creates a `<button></button>` element.
98384
98353
  *
98385
98354
  * The first parameter, `label`, is a string that sets the label displayed on
98386
98355
  * the button.
@@ -98457,7 +98426,7 @@ var p5 = (function () {
98457
98426
  };
98458
98427
 
98459
98428
  /**
98460
- * Creates a checkbox `&lt;input&gt;&lt;/input&gt;` element.
98429
+ * Creates a checkbox `<input></input>` element.
98461
98430
  *
98462
98431
  * Checkboxes extend the <a href="#/p5.Element">p5.Element</a> class with a
98463
98432
  * `checked()` method. Calling `myBox.checked()` returns `true` if it the box
@@ -98598,11 +98567,11 @@ var p5 = (function () {
98598
98567
  };
98599
98568
 
98600
98569
  /**
98601
- * Creates a dropdown menu `&lt;select&gt;&lt;/select&gt;` element.
98570
+ * Creates a dropdown menu `<select></select>` element.
98602
98571
  *
98603
98572
  * The parameter is optional. If `true` is passed, as in
98604
98573
  * `let mySelect = createSelect(true)`, then the dropdown will support
98605
- * multiple selections. If an existing `&lt;select&gt;&lt;/select&gt;` element
98574
+ * multiple selections. If an existing `<select></select>` element
98606
98575
  * is passed, as in `let mySelect = createSelect(otherSelect)`, the existing
98607
98576
  * element will be wrapped in a new <a href="#/p5.Element">p5.Element</a>
98608
98577
  * object.
@@ -98869,8 +98838,8 @@ var p5 = (function () {
98869
98838
  *
98870
98839
  * The parameter is optional. If a string is passed, as in
98871
98840
  * `let myRadio = createSelect('food')`, then each radio option will
98872
- * have `"food"` as its `name` parameter: `&lt;input name="food"&gt;&lt;/input&gt;`.
98873
- * If an existing `&lt;div&gt;&lt;/div&gt;` or `&lt;span&gt;&lt;/span&gt;`
98841
+ * have `"food"` as its `name` parameter: `<input name="food"></input>`.
98842
+ * If an existing `<div></div>` or `<span></span>`
98874
98843
  * element is passed, as in `let myRadio = createSelect(container)`, it will
98875
98844
  * become the radio button's parent element.
98876
98845
  *
@@ -98883,8 +98852,8 @@ var p5 = (function () {
98883
98852
  * - `myRadio.disable(shouldDisable)` enables the entire radio button if `true` is passed and disables it if `false` is passed.
98884
98853
  *
98885
98854
  * @method createRadio
98886
- * @param {Object} [containerElement] container HTML Element, either a `&lt;div&gt;&lt;/div&gt;`
98887
- * or `&lt;span&gt;&lt;/span&gt;`.
98855
+ * @param {Object} [containerElement] container HTML Element, either a `<div></div>`
98856
+ * or `<span></span>`.
98888
98857
  * @return {p5.Element} new <a href="#/p5.Element">p5.Element</a> object.
98889
98858
  *
98890
98859
  * @example
@@ -99003,7 +98972,7 @@ var p5 = (function () {
99003
98972
  */
99004
98973
  /**
99005
98974
  * @method createRadio
99006
- * @param {String} [name] name parameter assigned to each option's `&lt;input&gt;&lt;/input&gt;` element.
98975
+ * @param {String} [name] name parameter assigned to each option's `<input></input>` element.
99007
98976
  * @return {p5.Element} new <a href="#/p5.Element">p5.Element</a> object.
99008
98977
  */
99009
98978
  /**
@@ -99270,7 +99239,7 @@ var p5 = (function () {
99270
99239
  };
99271
99240
 
99272
99241
  /**
99273
- * Creates a text `&lt;input&gt;&lt;/input&gt;` element.
99242
+ * Creates a text `<input></input>` element.
99274
99243
  *
99275
99244
  * Call `myInput.size()` to set the length of the text box.
99276
99245
  *
@@ -99346,7 +99315,7 @@ var p5 = (function () {
99346
99315
  };
99347
99316
 
99348
99317
  /**
99349
- * Creates an `&lt;input&gt;&lt;/input&gt;` element of type `'file'`.
99318
+ * Creates an `<input></input>` element of type `'file'`.
99350
99319
  *
99351
99320
  * `createFileInput()` allows users to select local files for use in a sketch.
99352
99321
  * It returns a <a href="#/p5.File">p5.File</a> object.
@@ -99451,8 +99420,9 @@ var p5 = (function () {
99451
99420
 
99452
99421
  // If File API's are not supported, throw Error
99453
99422
  if (!(window.File && window.FileReader && window.FileList && window.Blob)) {
99454
- console.log(
99455
- 'The File APIs are not fully supported in this browser. Cannot create element.'
99423
+ p5._friendlyError(
99424
+ 'The File APIs are not fully supported in this browser. Cannot create element.',
99425
+ 'createFileInput'
99456
99426
  );
99457
99427
  return;
99458
99428
  }
@@ -103151,7 +103121,7 @@ var p5 = (function () {
103151
103121
  canvas.requestPointerLock =
103152
103122
  canvas.requestPointerLock || canvas.mozRequestPointerLock;
103153
103123
  if (!canvas.requestPointerLock) {
103154
- console.log('requestPointerLock is not implemented in this browser');
103124
+ p5._friendlyError('requestPointerLock is not implemented in this browser', 'requestPointerLock');
103155
103125
  return false;
103156
103126
  }
103157
103127
  canvas.requestPointerLock();
@@ -110745,9 +110715,7 @@ var p5 = (function () {
110745
110715
  * The parameter, `model`, is the
110746
110716
  * <a href="#/p5.Geometry">p5.Geometry</a> object to draw.
110747
110717
  * <a href="#/p5.Geometry">p5.Geometry</a> objects can be built with
110748
- * <a href="#/p5/buildGeometry">buildGeometry()</a>, or
110749
- * <a href="#/p5/beginGeometry">beginGeometry()</a> and
110750
- * <a href="#/p5/endGeometry">endGeometry()</a>. They can also be loaded from
110718
+ * <a href="#/p5/buildGeometry">buildGeometry()</a>. They can also be loaded from
110751
110719
  * a file with <a href="#/p5/loadGeometry">loadGeometry()</a>.
110752
110720
  *
110753
110721
  * Note: `model()` can only be used in WebGL mode.
@@ -132408,18 +132376,6 @@ var p5 = (function () {
132408
132376
  backend.generateBlock(blockID, strandsContext, generationContext);
132409
132377
  }
132410
132378
 
132411
- // Process any unvisited global assignments to ensure side effects are generated
132412
- for (const assignmentNodeID of strandsContext.globalAssignments) {
132413
- if (!generationContext.visitedNodes.has(assignmentNodeID)) {
132414
- // This assignment hasn't been visited yet, so we need to generate it
132415
- backend.generateAssignment(generationContext, strandsContext.dag, assignmentNodeID);
132416
- generationContext.visitedNodes.add(assignmentNodeID);
132417
- }
132418
- }
132419
-
132420
- // Reset global assignments for next hook
132421
- strandsContext.globalAssignments = [];
132422
-
132423
132379
  const firstLine = backend.hookEntry(hookType);
132424
132380
  let returnType;
132425
132381
  if (hookType.returnType.properties) {
@@ -133464,7 +133420,6 @@ var p5 = (function () {
133464
133420
  typeInfo,
133465
133421
  usedInVertex: false,
133466
133422
  usedInFragment: false,
133467
- declared: false
133468
133423
  });
133469
133424
 
133470
133425
  return createStrandsNode(id, dimension, strandsContext);
@@ -133828,7 +133783,6 @@ var p5 = (function () {
133828
133783
  ctx.vertexDeclarations = new Set();
133829
133784
  ctx.fragmentDeclarations = new Set();
133830
133785
  ctx.hooks = [];
133831
- ctx.globalAssignments = [];
133832
133786
  ctx.backend = backend;
133833
133787
  ctx.active = active;
133834
133788
  ctx.renderer = renderer;
@@ -133850,7 +133804,6 @@ var p5 = (function () {
133850
133804
  ctx.vertexDeclarations = new Set();
133851
133805
  ctx.fragmentDeclarations = new Set();
133852
133806
  ctx.hooks = [];
133853
- ctx.globalAssignments = [];
133854
133807
  ctx.active = false;
133855
133808
  p5.disableFriendlyErrors = ctx.previousFES;
133856
133809
  for (const key in ctx.windowOverrides) {
@@ -133995,7 +133948,7 @@ var p5 = (function () {
133995
133948
  * }
133996
133949
  *
133997
133950
  * function material() {
133998
- * let t = uniformFloat();
133951
+ * let t = millis();
133999
133952
  * worldInputs.begin();
134000
133953
  * // Move the vertex up and down in a wave in world space
134001
133954
  * // In world space, moving the object (e.g., with translate()) will affect these coordinates
@@ -134007,7 +133960,6 @@ var p5 = (function () {
134007
133960
  * function draw() {
134008
133961
  * background(255);
134009
133962
  * shader(myShader);
134010
- * myShader.setUniform('t', millis());
134011
133963
  * lights();
134012
133964
  * noStroke();
134013
133965
  * fill('red');
@@ -134096,9 +134048,7 @@ var p5 = (function () {
134096
134048
  * A value between `0.0` and `1.0`
134097
134049
  *
134098
134050
  * @example
134099
- * <div modernizr="webgl">
134100
- * <code>
134101
- * // Example 1: A soft vertical fade using smoothstep (no uniforms)
134051
+ * // Example 1: A soft vertical fade using smoothstep
134102
134052
  *
134103
134053
  * let fadeShader;
134104
134054
  *
@@ -134117,31 +134067,25 @@ var p5 = (function () {
134117
134067
  *
134118
134068
  * function setup() {
134119
134069
  * createCanvas(300, 200, WEBGL);
134120
- * fadeShader = baseFilterShader().modify(fadeCallback);
134070
+ * fadeShader = buildFilterShader(fadeCallback);
134121
134071
  * }
134122
134072
  *
134123
134073
  * function draw() {
134124
134074
  * background(0);
134125
134075
  * filter(fadeShader);
134126
134076
  * }
134127
- * </code>
134128
- * </div>
134129
134077
  *
134130
134078
  * @example
134131
- * <div modernizr="webgl">
134132
- * <code>
134133
- * // Example 2: Animate the smooth transition using a uniform
134079
+ * // Example 2: Animate the smooth transition over time
134134
134080
  *
134135
134081
  * let animatedShader;
134136
134082
  *
134137
134083
  * function animatedFadeCallback() {
134138
- * const time = uniformFloat(() => millis() * 0.001);
134139
- *
134140
134084
  * getColor((inputs) => {
134141
134085
  * let x = inputs.texCoord.x;
134142
134086
  *
134143
134087
  * // Move the smoothstep band back and forth over time
134144
- * let center = 0.5 + 0.25 * sin(time);
134088
+ * let center = 0.5 + 0.25 * sin(millis() * 0.001);
134145
134089
  * let t = smoothstep(center - 0.05, center + 0.05, x);
134146
134090
  *
134147
134091
  * return [t, t, t, 1];
@@ -134150,15 +134094,13 @@ var p5 = (function () {
134150
134094
  *
134151
134095
  * function setup() {
134152
134096
  * createCanvas(300, 200, WEBGL);
134153
- * animatedShader = baseFilterShader().modify(animatedFadeCallback);
134097
+ * animatedShader = buildFilterShader(animatedFadeCallback);
134154
134098
  * }
134155
134099
  *
134156
134100
  * function draw() {
134157
134101
  * background(0);
134158
134102
  * filter(animatedShader);
134159
134103
  * }
134160
- * </code>
134161
- * </div>
134162
134104
  */
134163
134105
 
134164
134106
  /**
@@ -134275,7 +134217,7 @@ var p5 = (function () {
134275
134217
  * }
134276
134218
  *
134277
134219
  * function material() {
134278
- * let t = uniformFloat();
134220
+ * let t = millis();
134279
134221
  * pixelInputs.begin();
134280
134222
  * // Animate alpha (transparency) based on x position
134281
134223
  * pixelInputs.color.a = 0.5 + 0.5 *
@@ -134286,7 +134228,6 @@ var p5 = (function () {
134286
134228
  * function draw() {
134287
134229
  * background(240);
134288
134230
  * shader(myShader);
134289
- * myShader.setUniform('t', millis());
134290
134231
  * lights();
134291
134232
  * noStroke();
134292
134233
  * fill('purple');
@@ -134477,7 +134418,7 @@ var p5 = (function () {
134477
134418
  * }
134478
134419
  *
134479
134420
  * function material() {
134480
- * let t = uniformFloat();
134421
+ * let t = millis();
134481
134422
  * objectInputs.begin();
134482
134423
  * // Create a sine wave along the object
134483
134424
  * objectInputs.position.y += sin(t * 0.001 + objectInputs.position.x);
@@ -134487,7 +134428,6 @@ var p5 = (function () {
134487
134428
  * function draw() {
134488
134429
  * background(220);
134489
134430
  * shader(myShader);
134490
- * myShader.setUniform('t', millis());
134491
134431
  * noStroke();
134492
134432
  * fill('orange');
134493
134433
  * sphere(50);
@@ -134519,7 +134459,7 @@ var p5 = (function () {
134519
134459
  * }
134520
134460
  *
134521
134461
  * function material() {
134522
- * let t = uniformFloat();
134462
+ * let t = millis();
134523
134463
  * cameraInputs.begin();
134524
134464
  * // Move vertices in camera space based on their x position
134525
134465
  * cameraInputs.position.y += 30 * sin(cameraInputs.position.x * 0.05 + t * 0.001);
@@ -134531,7 +134471,6 @@ var p5 = (function () {
134531
134471
  * function draw() {
134532
134472
  * background(200);
134533
134473
  * shader(myShader);
134534
- * myShader.setUniform('t', millis());
134535
134474
  * noStroke();
134536
134475
  * fill('red');
134537
134476
  * sphere(50);
@@ -134578,8 +134517,6 @@ var p5 = (function () {
134578
134517
  * will behave as a vec4 holding components r, g, b, and a (alpha), with each component being in the range 0.0 to 1.0.
134579
134518
  *
134580
134519
  * @example
134581
- * <div modernizr='webgl'>
134582
- * <code>
134583
134520
  * // A filter shader (using p5.strands) which will
134584
134521
  * // sample and invert the color of each pixel
134585
134522
  * // from the canvas.
@@ -134612,12 +134549,8 @@ var p5 = (function () {
134612
134549
  *
134613
134550
  * filterColor.end();
134614
134551
  * }
134615
- * </code>
134616
- *
134617
134552
  *
134618
134553
  * @example
134619
- * <div modernizr='webgl'>
134620
- * <code>
134621
134554
  * // This primitive edge-detection filter samples
134622
134555
  * // and compares the colors of the current pixel
134623
134556
  * // on the canvas, and a little to the right.
@@ -134674,8 +134607,6 @@ var p5 = (function () {
134674
134607
  * rotate(frameCount / 300);
134675
134608
  * square(0, 0, 30);
134676
134609
  * }
134677
- * </code>
134678
- * </div>
134679
134610
  */
134680
134611
 
134681
134612
  /**