p5.js icon indicating copy to clipboard operation
p5.js copied to clipboard

[p5.strands] Aliasing GLSL's mix as lerp

Open lukeplowden opened this issue 8 months ago • 3 comments

Increasing access

This change will increase access to p5.strands and shader programming in general by bridging the gap between core p5.js code and strands code.

Most appropriate sub-area of p5.js?

  • [ ] Accessibility
  • [ ] Color
  • [ ] Core/Environment/Rendering
  • [ ] Data
  • [ ] DOM
  • [ ] Events
  • [ ] Image
  • [ ] IO
  • [ ] Math
  • [ ] Typography
  • [ ] Utilities
  • [x] WebGL
  • [ ] Build process
  • [ ] Unit testing
  • [ ] Internationalization
  • [ ] Friendly errors
  • [ ] Other (specify if possible)

Feature enhancement details

As mentioned in #7849, GLSL has a built in function mix, which does the same operation as p5.js' lerp. We want to alias mix as lerp so that it can be used in shaders, as part of an effort to make more p5.js functions work as expected within p5.strands

lukeplowden avatar Jun 04 '25 15:06 lukeplowden

Hey @LalitNarayanYadav, I'm redirecting you to this sub issue of #7849 so you can implement this! Thank you for taking this on, and please @ me for any questions. Make a comment on this issue too, so that I can assign you to it.

lukeplowden avatar Jun 06 '25 08:06 lukeplowden

Hi @lukeplowden!

Thanks for redirecting me here. I'm ready to start working on the lerp alias for mix. Please assign me the issue and I’ll reach out if I have any questions along the way.

LalitNarayanYadav avatar Jun 07 '25 10:06 LalitNarayanYadav

Hi @lukeplowden

I've submitted PR #7887 for the lerp alias of GLSL’s mix function as discussed in #7875.

Could you please take a look when you get a chance and let me know if anything needs improvement?

Thanks !

LalitNarayanYadav avatar Jun 07 '25 23:06 LalitNarayanYadav