What's Changed
Testers Wanted 💚
This is a release candidate (RC), which means it is not yet live on the p5.js Editor. Please help us to improve the stability of the newest version of p5.js by trying out this release candidate, and reporting bugs.
To help with testing, you can use this starter sketch!
Or load both p5.js and WebGPU mode by adding these two script tags to your sketch:
<script src="https://cdn.jsdelivr.net/npm/p5@2.3.1-rc.1/lib/p5.js"></script>
<script src="https://cdn.jsdelivr.net/npm/p5@2.3.1-rc.1/lib/p5.webgpu.js"></script>Then load WebGPU mode in createCanvas - note the async/await, this is needed for WebGPU but not WebGL:
async function setup() {
await createCanvas(400, 400, WEBGPU);
}What's new
random() is available in p5.strands code - see the "static cube" example in the starter sketch or below!
More p5.js-style, beginner-friendly colors are also available, as well as initial work for a more p5.js-style instancing API. Besides testing these additions, we welcome suggestions for how to best demonstrate them in the starter sketch for the upcoming patch!
Related pulls:
- Add p5.strands support for randomGaussian() by @harshiltewari2004 in #8800
- Replace randomness-related noise usage in strands example by @VikasKSingh05 in #8824
- feat(strands): add color() support for beginner-friendly color inputs by @LalitNarayanYadav in #8822
- Add instanceIndex alias for instanceID by @aashu2006 in #8912
- fix builtin global accessors for instance mode in strands shaders by @aashu2006 in #8878
// This sketch uses an unreleased version of p5.js
// github.com/processing/p5.js/releases/tag/v2.3.1-rc.1
// Thanks for testing 💚
function setup() {
createCanvas(400, 400, WEBGL);
myShader = buildMaterialShader(myShaderBuilder);
}
function myShaderBuilder(){
finalColor.begin();
let coord = finalColor.texCoord;
finalColor.set(random(0.8));
finalColor.end();
}
function draw() {
stroke(255);
background("#f1678e");
shader(myShader);
orbitControl();
box(100);
}Custom shader bugfixes
- Fix WebGL shader version regex by @eupthere in #8857
- fix: preserve user-set uSampler uniform for custom shaders by @BHARATH0153 in #8869
Ongoing work on shapes & SVG
- fix : other shape use the shape class also add new roundrect Primitive by @VANSH3104 in #8899
- Fix
loadImageSVG file loading regression by @gfrancine in #8937
Other bugfixes
- fix: convert tint to RGBA array in _getTintedImageCanvas by @SarthakRawat-1 in #8934
- Fix orbitControl() breaking after touch swipe outside canvas. by @perminder-17 in #8863
- Fix object returns in p5.strands hooks by @davepagurek in #8950
- fixing-mouseClick by @perminder-17 in #8917
What's Changed 🎊
- Add shader examples to trigonometric functions by @SOUMITRO-SAHA in #8801
- Mark private methods as private by @ksen0 in #8854
- note strokeweight isn't scaled in webgl/webgpu by @Nixxx19 in #8850
- feat: add friendly error for cross-hook property access (#8813) by @BHARATH0153 in #8862
- Expose dimensions property on Vector by @ksen0 in #8874
- fix: correct textToContours and textToModel reference documentation (#8623) by @gourijain029-del in #8626
- Update 2.x top level docs to match main by @ksen0 in #8892
- Stewards workflow in main by @ksen0 in #8906
- Add shader examples for math functions by @SOUMITRO-SAHA in #8802
- Add friendly FES error for dimension mismatch on shared variable assi… by @harshiltewari2004 in #8823
- Update release workflow to check for prerelease by @ksen0 in #8956
New Contributors
- @VikasKSingh05 made their first contribution in #8824
- @BHARATH0153 made their first contribution in #8862
- @gourijain029-del made their first contribution in #8626
- @SarthakRawat-1 made their first contribution in #8934
- @gfrancine made their first contribution in #8937
Full Changelog: v2.3.0...v2.3.1-rc.1