Add noiseDetail() support for p5.strands#8163
Add noiseDetail() support for p5.strands#8163davepagurek merged 2 commits intoprocessing:dev-2.0from
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for noiseDetail() in p5.strands by exposing noise parameters (octaves and amplitude falloff) from the CPU-side noise implementation to shader uniforms. This allows WebGL strand rendering to respect user-specified noise detail settings.
Key changes:
- Added getter methods to retrieve current noise octaves and amplitude falloff values
- Modified noise shader to use uniform values for octaves and amplitude falloff instead of hardcoded values
- Updated strands API to register noise parameter uniforms when noise is used
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/webgl/shaders/functions/noise3DGLSL.glsl | Modified shader loop to support variable octaves and amplitude falloff via uniforms |
| src/strands/strands_api.js | Added logic to register noise parameter uniforms when noise is called in strands context |
| src/math/noise.js | Added private getter methods to expose noise parameters for shader use |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
89d82e6 to
eb3448c
Compare
|
This approach looks like it should work! I haven't yet had the chance to run this myself, but it would help with review if you tried making a test sketch that uses noise + noiseDetail in a strands shader. This can be in the p5 web editor, although there you'll have to manually upload your It also looks like there's a merge conflict that needs resolution. Is that something you're comfortable doing? |
|
https://editor.p5js.org/harshmastic/sketches/JAcdZZZNo |
|
Hi @hxrshxz! It looks like that example isn't using noise in p5.strands, it's using it in beginShape/endShape. A test of p5.strands would use noise to offset vertex positions in a shader, and then draw content using that shader. I also see that it's logging warnings about the usage of |
|
@davepagurek Sorry for the delay I was actually busy with my university exams . I Will update the Pull request in some days |
98982ff to
2936e42
Compare
2936e42 to
14d7857
Compare
|
https://editor.p5js.org/harshmastic/sketches/F4sFSd0wP - Here's the new sketch |
davepagurek
left a comment
There was a problem hiding this comment.
Sorry for the delay, this is looking good now!

Resolves #8160
Changes:
This PR adds support for
noiseDetail()in p5.strands by exposing noise parameters to shaders via uniforms.Screenshots of the change:
PR Checklist
npm run lintpasses