-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Alias GLSL's mix function as lerp in p5.strands (#7875) #7887
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
fixes #7875 |
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.
Thank you Lalit for working on this! I've left a couple of suggestions. What was causing a reference error, however? I can't recreate it. If you could let me know a bit about your dev environment that might help. How are you building the library or importing this module?
I was using VS Code but the issue I was facing was not because of environment. I had created a syntax error by mistake which I was not noticing. |
Thank you, almost there! Could you also remove the unused variable |
I have made the changes as you suggested. Please review it when you have time. |
Resolves #7875
Changes:
mix
function under the namelerp
inp5.strands
.lerp()
withinp5.strands
maps tomix()
when generating shader expressions.lerp()
function outside ofp5.strands
.Rationale:
This change bridges the gap between core
p5.js
andp5.strands
by makinglerp()
work seamlessly within shader code. It increases accessibility by allowing familiar p5.js functions to be used in new contexts.A short inline comment was also added for clarity:
PR Checklist
npm run lint
passes