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

loadFilterShader fixes #7636

Merged
merged 4 commits into from
Mar 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/empty-example/sketch.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function setup() {
// put setup code here
}

function draw() {
// put drawing code here
}
// put setup code here
}
function draw() {
// put drawing code here
}
6 changes: 3 additions & 3 deletions src/webgl/material.js
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ function material(p5, fn){
* let myShader;
*
* async function setup() {
* myShader = await loadFilterShader('assets/shader.frag');
* myShader = await loadFilterShader('assets/basic.frag');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there were some linking issue with vertex shader from shader.frag, so using basic.frag

Screenshot from 2025-03-16 03-50-04

* createCanvas(100, 100, WEBGL);
* noStroke();
* }
Expand All @@ -543,15 +543,15 @@ function material(p5, fn){
* shader(myShader);
*
* // rect gives us some geometry on the screen
* rect(0, 0, width, height);
* rect(-50, -50, width, height);
* }
* </code>
* </div>
* @alt
* A rectangle with a shader applied to it.
*/
fn.loadFilterShader = async function (fragFilename, successCallback, failureCallback) {
p5._validateParameters('loadFilterShader', arguments);
// p5._validateParameters('loadFilterShader', arguments);
try {
// Load the fragment shader
const fragSrc = await this.loadStrings(fragFilename);
Expand Down