Skip to content

Conversation

@Scoutersq
Copy link

Resolves #8200

Changes:

  • Fixed a bug in WebGL shaders where the uSampler uniform was being reset to an empty texture, causing user-defined shaders to render blank.
  • The fix ensures uSampler is only reset for internal p5.js shaders, not for shaders where the user manually set the uniform.
  • Added a manual test file fix-shader.html to verify the fix: drawing a red rectangle using a custom FBO shader works correctly.

Screenshots of the change:

  • Red rectangle appears correctly when using the fix-shader.html test (previously rendered blank).

PR Checklist

  • npm run lint passes
  • Inline reference is included / updated
  • Manual test file (fix-shader.html) included
  • Unit tests are included / updated

@welcome
Copy link

welcome bot commented Oct 26, 2025

🎉 Thanks for opening this pull request! For guidance on contributing, check out our contributor guidelines and other resources for contributors!
🤔 Please ensure that your PR links to an issue, which has been approved for work by a maintainer; otherwise, there might already be someone working on it, or still ongoing discussion about implementation. You are welcome to join the discussion in an Issue if you're not sure!
🌸 Once your PR is merged, be sure to add yourself to the list of contributors on the readme page !

Thank You!

Copy link
Collaborator

@perminder-17 perminder-17 left a comment

Choose a reason for hiding this comment

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

I think the issue is in 2.x versions.

p5.js version

2.0.5 (2.0+)

We need to retarget it to dev-2.0 branch.

@davepagurek
Copy link
Contributor

I'm going to close this since another contributor has asked first, as per our contribution guidelines.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[p5.js 2.0 Bug Report]: p5.js overrides uSampler uniform for user shaders

3 participants