strokeCap in P3D not working

Just for a background, I’m currently using P3D for 2D animations instead of the default, P2D, and FX2D because of performance issues that I get with the customization of strokes. I assume this probably has something to do with AMD graphics drivers and the fact that I have a relatively old laptop so I had no choice.

The downside that I got however is that I can only have a square strokeCap in P3D. The following is a sample demonstrating the strokeCaps:

void setup() {
    ...
    strokeWeight(10);
    stroke(255);
}
    
void draw() {
    background(0);
    strokeCap(PROJECT); line(50, 50, 200, 50);
    strokeCap(SQUARE); line(50, 100, 200, 100);
    strokeCap(ROUND); line(50, 150, 200, 150);
}

image

Is this behaviour by default or is this a bug? The documentation however doesn’t mention anything that strokeCaps don’t work in P3D

Further researching in google led me to discussions from the previous processing forum where it explains about this issue but I honestly do not understand the conclusion from these:

Apparently, the discussions are also relatively old so I’m not sure if this has been fixed already.

Someone might suggest though that since this is only in 2D, I can just simply use ellipse() or square() at the points but they won’t really benefit in cases where the strokes are partially transparent :frowning:

Just experimenting…

void setup() 
  {
  size(640, 360, P3D);  
  }

void draw()
  {
  background(200, 0, 0);
  translate(width/2, height/2);
  rotateX(frameCount*TAU/500);
  rotateY(frameCount*TAU/500);
  
  float s = map(mouseX, 0, width, 5, 100);
  
  noStroke();
  fill(255, 255, 0, 150);
  arc(100, 0, s, s, -TAU/4,  TAU/4, OPEN);
  arc(-100, 0, s, s, TAU/4, 3*TAU/4, OPEN);
  
  rectMode(CENTER);
  rect(0, 0, 200, s);
  
  //stroke(255, 255, 0, 100);
  //strokeWeight(50);
  //line(-100, 0, 100, 0);
  }

image