Skip to content

Comments

experimental: simplify strands tutorial (flat API, no uniforms, no arrow fns)#1182

Draft
nbogie wants to merge 1 commit intoprocessing:2.0from
nbogie:nb-strands-tut-both-simplifications
Draft

experimental: simplify strands tutorial (flat API, no uniforms, no arrow fns)#1182
nbogie wants to merge 1 commit intoprocessing:2.0from
nbogie:nb-strands-tut-both-simplifications

Conversation

@nbogie
Copy link
Contributor

@nbogie nbogie commented Feb 19, 2026

This is an experimental PR to allow us to see how the strands tutorial might look if simplified, and what problems we might encounter in trying that.

Status:

  • Uses flat API throughout
  • Uses buildXShader instead of base().modify()
  • Zero arrow functions (once the placeholder for millis() is removed)
  • Removed definition of rand(). Use built-in noise() instead
  • fix incorrectly indenting sketches (all code spans need two sacrificial leading spaces)
  • All but one* use of uniform replaced with now built-in variables

* Actually, you'll see two uses of uniform remaining:

  • a temporary one which serves to provide time (and keep sketches working) until millis() is implemented in strands. (added as a separate commit which can be reverted).

  • uniformTexture, used to get the original image into the bloom filter. I don't have a solution for how to remove this one and keep the bloom filter.

  • ISSUE: The uniform mechanism being used by uniformTexture is yet to be explained in this branch.

base().modify() becomes buildXShader()
removed all arrow fns except in the placeholder for millis()
fix incorrect indenting of code spans
js fenced blocks don't need initial indentation
removing uniforms as far as possible from already flat-API tut.
use noise() instead of  defining a rand()
@nbogie nbogie force-pushed the nb-strands-tut-both-simplifications branch from 3f43457 to 6fe4553 Compare February 19, 2026 12:45
@ksen0
Copy link
Member

ksen0 commented Feb 19, 2026

(Minor note: millis() processing/p5.js#8530 is very close. It is aimed for 2.2.2, which is done except for that PR. So I think it is reasonable to expect millis() to be available in a patch release in the next few days.)

@nbogie
Copy link
Contributor Author

nbogie commented Feb 19, 2026

Ta. (It looks like the build is breaking for unrelated reasons (401))

Update: at build, the site is pre-rendering pages for /sketches/<sketchid>, and to do so has to fetch some details of the sketch from the openprocessing API. These fetches were failing with 401 (possibly getting throttled by openprocessing).

Nothing to do with this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants