Skip to content

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

Open
aashu2006 wants to merge 1 commit intoprocessing:dev-2.0from
aashu2006:fix-instance-mode-uniformfloat
Open

Fix instance mode usage of uniformFloat() in shader.modify() example#8470
aashu2006 wants to merge 1 commit 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)

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.

1 participant