Possibly just the way that layering and compositing works in the graphics pipeline.
Some solutions:
- change draw order – draw text last
- render text to a PGraphics (which has a transparent background) and then place it in a z layer using image();
- 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:
- create a P3D sketch
- create a P2D PGraphics
- draw your 2D scene(2) exactly as you want, with no layering problems, on the PGraphics
- place it in your 3D space with image()