p5 2.2.2-rc.0 → 2.2.2-rc.2
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.
- package/dist/accessibility/color_namer.js +5 -5
- package/dist/accessibility/index.js +5 -5
- package/dist/app.js +5 -5
- package/dist/color/color_conversion.js +5 -5
- package/dist/color/creating_reading.js +1 -1
- package/dist/color/index.js +2 -2
- package/dist/color/p5.Color.js +1 -1
- package/dist/color/setting.js +2 -2
- package/dist/{constants-D3npMLOW.js → constants--VqmEGYW.js} +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/environment.js +1 -1
- package/dist/core/filterShaders.js +1 -1
- package/dist/core/friendly_errors/fes_core.js +1 -1
- package/dist/core/friendly_errors/file_errors.js +1 -1
- package/dist/core/friendly_errors/index.js +1 -1
- package/dist/core/friendly_errors/param_validator.js +1 -1
- package/dist/core/friendly_errors/sketch_verifier.js +1 -1
- package/dist/core/helpers.js +1 -1
- package/dist/core/init.js +5 -5
- package/dist/core/internationalization.js +1 -1
- package/dist/core/legacy.js +5 -5
- package/dist/core/main.js +5 -5
- package/dist/core/p5.Graphics.js +4 -4
- package/dist/core/p5.Renderer.js +3 -3
- package/dist/core/p5.Renderer2D.js +5 -5
- package/dist/core/p5.Renderer3D.js +4 -4
- package/dist/core/rendering.js +4 -4
- package/dist/{creating_reading-ZXzcZEsb.js → creating_reading-C7hu6sg1.js} +2 -2
- package/dist/dom/dom.js +2 -2
- package/dist/dom/index.js +2 -2
- package/dist/dom/p5.Element.js +2 -2
- package/dist/dom/p5.MediaElement.js +2 -2
- package/dist/image/const.js +1 -1
- package/dist/image/filterRenderer2D.js +4 -4
- package/dist/image/image.js +4 -4
- package/dist/image/index.js +4 -4
- package/dist/image/loading_displaying.js +4 -4
- package/dist/image/p5.Image.js +3 -3
- package/dist/io/files.js +4 -4
- package/dist/io/index.js +4 -4
- package/dist/{main-C5AeICIY.js → main-DifEeQiX.js} +4 -4
- package/dist/math/Matrices/Matrix.js +1 -1
- package/dist/math/Matrices/MatrixNumjs.js +1 -1
- package/dist/math/index.js +1 -1
- package/dist/math/p5.Matrix.js +1 -1
- package/dist/math/p5.Vector.js +1 -1
- package/dist/math/trigonometry.js +1 -1
- package/dist/{p5.Renderer-xpFkUQC6.js → p5.Renderer-BuaG4snH.js} +2 -2
- package/dist/{rendering-B8po3Onj.js → rendering-uHkWQXtu.js} +3 -3
- package/dist/shape/2d_primitives.js +1 -1
- package/dist/shape/attributes.js +1 -1
- package/dist/shape/custom_shapes.js +2 -2
- package/dist/shape/index.js +2 -2
- package/dist/strands/strands_api.js +43 -14
- package/dist/type/index.js +3 -3
- package/dist/type/p5.Font.js +3 -3
- package/dist/type/textCore.js +3 -3
- package/dist/webgl/3d_primitives.js +4 -4
- package/dist/webgl/GeometryBuilder.js +1 -1
- package/dist/webgl/ShapeBuilder.js +1 -1
- package/dist/webgl/enums.js +1 -1
- package/dist/webgl/index.js +4 -4
- package/dist/webgl/interaction.js +1 -1
- package/dist/webgl/light.js +4 -4
- package/dist/webgl/loading.js +4 -4
- package/dist/webgl/material.js +4 -4
- package/dist/webgl/p5.Camera.js +4 -4
- package/dist/webgl/p5.Framebuffer.js +4 -4
- package/dist/webgl/p5.Geometry.js +1 -1
- package/dist/webgl/p5.Quat.js +1 -1
- package/dist/webgl/p5.RendererGL.js +4 -4
- package/dist/webgl/p5.Texture.js +4 -4
- package/dist/webgl/text.js +4 -4
- package/dist/webgl/utils.js +4 -4
- package/dist/webgpu/index.js +1 -1
- package/dist/webgpu/p5.RendererWebGPU.js +2 -2
- package/lib/p5.esm.js +47 -18
- package/lib/p5.esm.min.js +1 -1
- package/lib/p5.js +47 -18
- package/lib/p5.min.js +1 -1
- package/lib/p5.webgpu.esm.js +2 -2
- package/lib/p5.webgpu.js +2 -2
- package/lib/p5.webgpu.min.js +1 -1
- package/package.json +1 -1
- package/types/global.d.ts +4 -4
- package/types/p5.d.ts +2 -2
package/lib/p5.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! p5.js v2.2.2-rc.
|
|
1
|
+
/*! p5.js v2.2.2-rc.2 February 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.2-rc.
|
|
18
|
+
const VERSION = '2.2.2-rc.2';
|
|
19
19
|
|
|
20
20
|
// GRAPHICS RENDERER
|
|
21
21
|
/**
|
|
@@ -12614,11 +12614,11 @@ var p5 = (function () {
|
|
|
12614
12614
|
* values. 0 is equal to the first color, 0.1 is very near the first color,
|
|
12615
12615
|
* 0.5 is halfway between the two colors, and so on. Negative numbers are set
|
|
12616
12616
|
* to 0. Numbers greater than 1 are set to 1. This differs from the behavior of
|
|
12617
|
-
* <a href="#/lerp">lerp</a>. It's necessary because numbers outside of the
|
|
12617
|
+
* <a href="#/p5/lerp">lerp</a>. It's necessary because numbers outside of the
|
|
12618
12618
|
* interval [0, 1] will produce strange and unexpected colors.
|
|
12619
12619
|
*
|
|
12620
12620
|
* The way that colors are interpolated depends on the current
|
|
12621
|
-
* <a href="#/colorMode">colorMode()</a>.
|
|
12621
|
+
* <a href="#/p5/colorMode">colorMode()</a>.
|
|
12622
12622
|
*
|
|
12623
12623
|
* @method lerpColor
|
|
12624
12624
|
* @param {p5.Color} c1 interpolate from this color.
|
|
@@ -132385,32 +132385,45 @@ var p5 = (function () {
|
|
|
132385
132385
|
return strandsContext._builtinGlobals
|
|
132386
132386
|
}
|
|
132387
132387
|
|
|
132388
|
-
function
|
|
132389
|
-
const spec = BUILTIN_GLOBAL_SPECS[name];
|
|
132390
|
-
if (!spec) return null
|
|
132391
|
-
|
|
132388
|
+
function getOrCreateUniformNode(strandsContext, uniformName, typeInfo, defaultValueFn) {
|
|
132392
132389
|
const cache = _getBuiltinGlobalsCache(strandsContext);
|
|
132393
|
-
|
|
132390
|
+
|
|
132394
132391
|
const cached = cache.nodes.get(uniformName);
|
|
132395
|
-
if (cached) return cached
|
|
132392
|
+
if (cached) return cached;
|
|
132396
132393
|
|
|
132397
132394
|
if (!cache.uniformsAdded.has(uniformName)) {
|
|
132398
132395
|
cache.uniformsAdded.add(uniformName);
|
|
132399
132396
|
strandsContext.uniforms.push({
|
|
132400
132397
|
name: uniformName,
|
|
132401
|
-
typeInfo
|
|
132402
|
-
defaultValue:
|
|
132403
|
-
const p5Instance = strandsContext.renderer?._pInst || strandsContext.p5?.instance;
|
|
132404
|
-
return p5Instance ? spec.get(p5Instance) : undefined
|
|
132405
|
-
},
|
|
132398
|
+
typeInfo,
|
|
132399
|
+
defaultValue: defaultValueFn,
|
|
132406
132400
|
});
|
|
132407
132401
|
}
|
|
132408
132402
|
|
|
132409
|
-
const { id, dimension } = variableNode(strandsContext,
|
|
132403
|
+
const { id, dimension } = variableNode(strandsContext, typeInfo, uniformName);
|
|
132410
132404
|
const node = createStrandsNode(id, dimension, strandsContext);
|
|
132411
|
-
node._originalBuiltinName = name;
|
|
132412
132405
|
cache.nodes.set(uniformName, node);
|
|
132413
|
-
return node
|
|
132406
|
+
return node;
|
|
132407
|
+
}
|
|
132408
|
+
|
|
132409
|
+
function getBuiltinGlobalNode(strandsContext, name) {
|
|
132410
|
+
const spec = BUILTIN_GLOBAL_SPECS[name];
|
|
132411
|
+
if (!spec) return null;
|
|
132412
|
+
|
|
132413
|
+
const uniformName = `_p5_global_${name}`;
|
|
132414
|
+
const instance = strandsContext.renderer?._pInst || strandsContext.p5?.instance;
|
|
132415
|
+
|
|
132416
|
+
const node = getOrCreateUniformNode(
|
|
132417
|
+
strandsContext,
|
|
132418
|
+
uniformName,
|
|
132419
|
+
spec.typeInfo,
|
|
132420
|
+
() => {
|
|
132421
|
+
return instance ? spec.get(instance) : undefined;
|
|
132422
|
+
}
|
|
132423
|
+
);
|
|
132424
|
+
|
|
132425
|
+
node._originalBuiltinName = name;
|
|
132426
|
+
return node;
|
|
132414
132427
|
}
|
|
132415
132428
|
|
|
132416
132429
|
function installBuiltinGlobalAccessors(strandsContext) {
|
|
@@ -132573,6 +132586,7 @@ var p5 = (function () {
|
|
|
132573
132586
|
// Add noise function with backend-agnostic implementation
|
|
132574
132587
|
const originalNoise = fn.noise;
|
|
132575
132588
|
const originalNoiseDetail = fn.noiseDetail;
|
|
132589
|
+
const originalMillis = fn.millis;
|
|
132576
132590
|
|
|
132577
132591
|
strandsContext._noiseOctaves = null;
|
|
132578
132592
|
strandsContext._noiseAmpFalloff = null;
|
|
@@ -132635,6 +132649,21 @@ var p5 = (function () {
|
|
|
132635
132649
|
return createStrandsNode(id, dimension, strandsContext);
|
|
132636
132650
|
};
|
|
132637
132651
|
|
|
132652
|
+
fn.millis = function (...args) {
|
|
132653
|
+
if (!strandsContext.active) {
|
|
132654
|
+
return originalMillis.apply(this, args);
|
|
132655
|
+
}
|
|
132656
|
+
const instance = strandsContext.renderer?._pInst || strandsContext.p5?.instance;
|
|
132657
|
+
return getOrCreateUniformNode(
|
|
132658
|
+
strandsContext,
|
|
132659
|
+
'_p5_global_millis',
|
|
132660
|
+
DataType.float1,
|
|
132661
|
+
() => {
|
|
132662
|
+
return instance ? instance.millis() : undefined;
|
|
132663
|
+
}
|
|
132664
|
+
);
|
|
132665
|
+
};
|
|
132666
|
+
|
|
132638
132667
|
// Next is type constructors and uniform functions.
|
|
132639
132668
|
// For some of them, we have aliases so that you can write either a more human-readable
|
|
132640
132669
|
// variant or also one more directly translated from GLSL, or to be more compatible with
|