change strands examples to use millis() not uniform#8648
Merged
ksen0 merged 3 commits intoprocessing:dev-2.0from Mar 16, 2026
Merged
change strands examples to use millis() not uniform#8648ksen0 merged 3 commits intoprocessing:dev-2.0from
ksen0 merged 3 commits intoprocessing:dev-2.0from
Conversation
ksen0
reviewed
Mar 16, 2026
| * myShader = baseMaterialShader().modify(() => { | ||
| * // Get the current time from p5.js | ||
| * let t = uniformFloat(() => millis()); | ||
| * // Get the move counter from our sketch |
Member
Mouse interaction makes sense! I think keyboard interaction is a more complex example that will need to rely on uniform. Ideally using |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #8645
Changes:
Don't use a uniform to pass time in strands examples in p5.strands.js, material.js. Instead use millis() built-in.
In the example of how to pass a uniform for modify(), don't pass time as this now is not motivating. Instead, use an example where we'd NEED to use a uniform. (I chose a count of mouse movements - is there a simpler, easily demonstrated value that is not also covered by a built-in?)
Snuck in a couple of minor tidy-ups of other strands examples:
3.1. removed old
<div><code>element wrappers around examples in getTexture and smoothstep (the final remnants in the code-base).3.2 had smoothstep examples use
buildFilterShaderinstead ofbaseFilterShader().modifyChanges per file and URL:
p5.strands.jsone replacement in each of the following:
material.jsfinalColorhook to changewhat I searched for
\*.*uniformFloat\(\*.*setUniform\(\*.*millis\(\)PR Checklist
npm run lintpassessome unrelated unit test failures (mostly time-outs): noise, shape modes, typography.
AI Usage
No AI was used in this PR or this write-up