docs: add documentation for mix() method in p5.strands#8463
docs: add documentation for mix() method in p5.strands#8463Anshumancanrock wants to merge 1 commit intoprocessing:dev-2.0from
Conversation
|
🎉 Thanks for opening this pull request! For guidance on contributing, check out our contributor guidelines and other resources for contributors! Thank You! |
src/strands/p5.strands.js
Outdated
| * let gradient = pixelInputs.uv.x; | ||
| * let color1 = vec3(1, 0.5, 0); // Orange | ||
| * let color2 = vec3(0.5, 0, 1); // Purple | ||
| * pixelInputs.color = vec4(mix(color1, color2, gradient), 1); |
There was a problem hiding this comment.
Heads up, you may need to set pixelInputs.ambientColor = pixelInputs.color.rgb to avoid the default color still being used for ambient light.
Separately, we may want to open an issue to decide how to deal with that, since its somewhat unintuitive and a pretty common use case.
There was a problem hiding this comment.
Heads up, you may need to set
pixelInputs.ambientColor = pixelInputs.color.rgbto avoid the default color still being used for ambient light.Separately, we may want to open an issue to decide how to deal with that, since its somewhat unintuitive and a pretty common use case.
Agreed, it does seem unintuitive that ambient color doesn't automatically follow the material color. Opening a separate issue would be a good idea. I will open one soon .
|
I think this generally looks good, would you mind testing the examples in the p5.js-website repo (see instructions here https://github.com/processing/p5.js-website/blob/main/docs/scripts.md#testing-the-docs-of-your-fork) and showing screenshots of each? This also helps ensure they run correctly. |
b1f7b3e to
fb9dd40
Compare
|
@davepagurek Thanks for the heads up! I've updated examples to use |
|
@davepagurek I tested the examples locally on the p5.js-website by building the reference from my fork's branch. The mix() page renders correctly with all three examples. Here is the video: ps51.mp4The description, syntax, parameters, and all three examples (basic color mix, position-based mix, gradient mix) show up as expected. Please let me know if you would like any further changes. Thank you :) |
Resolves #8441
Changes:
Added documentation for the
mix()method in p5.strands. This GLSL built-in function was already implemented but missing from the reference documentation.The documentation includes:
PR Checklist
npm run lintpasses