Skip to content

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

Open
@RandomGamingDev

Description

@RandomGamingDev

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions