Replace randomness-related noise usage in strands example#8824
Replace randomness-related noise usage in strands example#8824VikasKSingh05 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Hi @VikasKSingh05 , your changes are correct but it doesn't fully solves the issue.
The issue states
We probably need to look through all the strands reference items to get a full list of what might need to be updated.
And, I think there are some more references where it should use random() instead of noise, Do you mind checking them all and replacing them as did with the buildStrokeShader one?
|
Hi @perminder-17 , I've reviewed all p5.strands examples for Changed in this PR:
Kept as
|
Resolves #8776
Changes:
Replaced
noise(pixelInputs.position.xy)withrandom()in the dithering example within thebuildStrokeShader()inline documentation insrc/webgl/material.js.Reasoning:
The
noise()function was previously used as a workaround whenrandom()wasn't supported in p5.strands. For dithering (randomly setting pixel transparency), pure randomness is more appropriate than spatially-coherent noise. This change makes the example clearer and more consistent with standard p5.js usage.Scope:
After reviewing all p5.strands examples in the codebase, this was the only instance where
noise()was used purely as a substitute for randomness. Other uses ofnoise()in examples involve intentional smooth spatial/temporal variation and should remain unchanged.Screenshots of the change:
N/A - This is a documentation change in inline code examples. The visual output will show proper random dithering instead of patterned noise-based dithering.
PR Checklist
npm run lintpasses