Skip to content
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

Change text vertex order of text to be consistent with regular rendering for backface culling #7619

Open
1 of 17 tasks
RandomGamingDev opened this issue Mar 11, 2025 · 2 comments

Comments

@RandomGamingDev
Copy link
Contributor

Increasing access

When rendering rectangles, the backface can be culled by doing

drawingContext.enable(drawingContext.CULL_FACE);
drawingContext.cullFace(drawingContext.FRONT);

This is true for rectangless, planes, cubes, and most objects in general.

However, the one exception I've found is text.
With this having practically no other effect and most programs not getting broken by this change (those complex enough to use those features and get affected would likely use a specific version of p5.js whether via cdn or local package anyways) I believe it's worth it to make the change for programs that can use the performance.

While it'd be preferable for

drawingContext.cullFace(drawingContext.BACK);

to work the way most people using WebGL would use it, I don't believe that would be the best route given that there are likely some programs that already rely on this.

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build process
  • Unit testing
  • Internationalization
  • Friendly errors
  • Other (specify if possible)

Feature enhancement details

Change the order of the vertices so that they're going in the other direction rotationally from any perspective.

@TejasNangru
Copy link

@RandomGamingDev If you are not working on this, maybe I can give it a try?
@ksen0 Please assign me this issue.

@RandomGamingDev
Copy link
Contributor Author

@RandomGamingDev If you are not working on this, maybe I can give it a try? @ksen0 Please assign me this issue.

I was planning on fixing it once I got confirmation, but if you want to work on it you're more than welcome to do so.

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

No branches or pull requests

3 participants