Skip to content
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

Add a version of Processing's loadShader() function to p5.js #6852

Open
2 of 17 tasks
Metamere opened this issue Mar 13, 2024 · 4 comments
Open
2 of 17 tasks

Add a version of Processing's loadShader() function to p5.js #6852

Metamere opened this issue Mar 13, 2024 · 4 comments

Comments

@Metamere
Copy link

Metamere commented Mar 13, 2024

Increasing access

It would provide a utility and convenience function. It would allow for a smaller main script, which could make things easier to manage, especially when working in the on-line editor with large shader files.

Most appropriate sub-area of p5.js?

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

Feature request details

p5.js now has a createFilterShader() function where one can create a filter from just a fragment shader, which needs to be defined in the main script file. It would make sense to provide a loadFilterShader() function to allow for creating a filter shader by loading from a separate file, just like loadShader() provides that utility to accompany the createShader function. It would keep things consistent.

Copy link

welcome bot commented Mar 13, 2024

Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, please make sure to fill out the inputs in the issue forms. Thank you!

@limzykenneth
Copy link
Member

This is already available here or are you thinking of something else?

@davepagurek
Copy link
Contributor

@limzykenneth I think they're referring to an equivalent of createFilterShader, which does the vertex shader for you and makes sure it's bound to the right WebGL context automatically. We don't have a load* equivalent for that just yet, so it would make sense to me to add it for consistency

@Metamere
Copy link
Author

@limzykenneth, @davepagurek, you're both correct. I was trying to help by creating this to address an issue someone else brought up, but I misunderstood and messed it up initially. Hopefully the current version is correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants