Change or fix text Background in P3D

Possibly just the way that layering and compositing works in the graphics pipeline.

Some solutions:

  1. change draw order – draw text last
  2. render text to a PGraphics (which has a transparent background) and then place it in a z layer using image();
  3. try using hint(); e.g. pg.hint(ENABLE_DEPTH_SORT); – this may require you to separate out your other layers as well. hint() / Reference / Processing.org

Trying to do 2D in 3D is often going to cause a variety of unwelcome z-fighting problems. In general it is much easier to:

  1. create a P3D sketch
  2. create a P2D PGraphics
  3. draw your 2D scene(2) exactly as you want, with no layering problems, on the PGraphics
  4. place it in your 3D space with image()
2 Likes