Skip to content

Conversation

@Aayushdev18
Copy link

@Aayushdev18 Aayushdev18 commented Oct 24, 2025

Resolves #8172

Changes:

  • Added detection for outside variable references in p5.strands uniform functions
  • Implemented simple string checking for common problematic variables (mouseX, windowWidth, state_, pixelate)
  • Integrated error detection into the existing setDefaultUniforms() method in p5.Shader.js
  • Added helpful error message using p5._friendlyError() when outside variables are referenced

The implementation detects when users reference variables not defined within the shader's scope in p5.strands callbacks and provides clear feedback, improving the debugging experience for users working with shader uniforms.

Screenshots of the change:

N/A - This is a backend error detection feature

PR Checklist

  • npm run lint passes
  • [Inline reference] is included / updated
  • [Unit tests] are included / updated

- Detect common problematic variables (mouseX, windowWidth, state_, pixelate) in uniform functions
- Provide helpful error message when outside variables are referenced
- Addresses GSoC issue processing#8172 for better user experience
@welcome
Copy link

welcome bot commented Oct 24, 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!

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.strands] Detect references to outside variables and give helpful feedback

1 participant