-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Add noiseDetail() support for p5.strands #8163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev-2.0
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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 lint
passes