Skip to content

Fix corrupted textures when rendering too many WebGL characters #7792

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

Merged
merged 1 commit into from
May 6, 2025

Conversation

davepagurek
Copy link
Contributor

Resolves #7787

Changes:

  • Caches WebGL font data based on the individual data textures rather than per glyph (since glyphs share some of the data textures)
  • Removes font IDs since we no longer need to create a custom cache key -- the cache can be based on unique ImageData object references now
  • Adds a visual test to prevent regressions

Screenshots of the change:

Before:
image

After:
image

Live: https://editor.p5js.org/davepagurek/sketches/HOCMo0I8F

PR Checklist

@davepagurek davepagurek merged commit c2467d0 into dev-2.0 May 6, 2025
2 checks passed
@davepagurek davepagurek deleted the fix/webgl-text-rendering branch May 6, 2025 12:46
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