processing / processing/processing4
Request: add a createShader( String [] vertSrc, String [] fragSrc ) function like p5.js has
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 494
- Forks
- 183
- Avg merge
- 4h 39m
- Merged PRs (30d)
- 3
Description
Created by: scudly
Now that we have multi-line strings, it is practical to include shader code directly in sketches (or even to construct them programmatically) rather than reading from an external file. The current publicly supported and documented loadShader() API only cleanly supports reading shaders from files. Ideally, we would also have a createShader( String[] fragSrc ) that infers the type and provides a vertex shader as the current loadShader() does.
Passing the source as an array of strings seems more general than taking it as a single, multi-line string and is trivial enough to express in code. It also matches the existing PShader constructors.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the documented loadShader() API and the existing PShader constructors, both named in the issue. Compare their handling of shader sources and vertex-shader defaults. The work is done when sketches can construct shaders from String[] sources for both the explicit vertex/fragment form and the inferred form described in the request.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, computer-graphics
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100