Skip to content

Fix instance mode usage of uniformFloat() in shader.modify() example#8470

Merged
davepagurek merged 2 commits intoprocessing:dev-2.0from
aashu2006:fix-instance-mode-uniformfloat
Feb 7, 2026
Merged

Fix instance mode usage of uniformFloat() in shader.modify() example#8470
davepagurek merged 2 commits intoprocessing:dev-2.0from
aashu2006:fix-instance-mode-uniformfloat

Conversation

@aashu2006
Copy link

Resolves #8467

Changes

  • Fixed the instance mode example for p5.shader.modify() in the reference.
  • Updated the example to use sketch.uniformFloat('b') instead of calling uniformFloat() as a global function.
  • This aligns the example with correct instance mode usage, where all p5 APIs must be accessed via the sketch instance.

The issue occurred because the example already uses sketch.createCanvas() and sketch.background(), but missed prefixing uniformFloat() with sketch, causing a runtime error in instance mode.

PR Checklist

  • npm run lint passes
  • [Inline reference] is included / updated
  • [Unit tests] are included / updated (not applicable for documentation change)

Copy link
Contributor

@davepagurek davepagurek left a comment

Choose a reason for hiding this comment

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

thanks for the fix!

@davepagurek davepagurek merged commit 4fc91bf into processing:dev-2.0 Feb 7, 2026
2 checks passed
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.

2 participants