processing / processing/p5.js

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

Open
#7,619 2 comments 0 reactions 1 assignee View on GitHub

@davepagurek is already working on this.

Since Mar 15, 2025.

Area:WebGL Enhancement
Dominant language
JavaScript
Stars
24k
Forks
3.8k
Avg merge
3d 16h
Merged PRs (30d)
25

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.