Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Choosing a renderer - difference between default and J2D?

The Processing size() documentation says:

In addition to the default renderer, other renderers are: P2D, P3D, PDF

So what's the difference between Default and J2D?

There used to be JAVA2D, P2D, P3D and OPENGL before v2 and I believe that P3D is now just OPENGL.

This link has some relevant info Life Saving Tips For Processing

like image 720
CatsLoveJazz Avatar asked Mar 21 '23 00:03

CatsLoveJazz


1 Answers

There are 4 render modes in Processing 2.0:

  • default ("slow" but very accurate 2D render mode)

  • P2D (OPENGL, faster but less accurate 2D render mode)

  • P3D (OPENGL and well, 3D)

  • PDF (for PDF output)

default | P2D | P3D

defaultP2DP3D

Code I used to create these images:

void setup() {
  //size(200, 200);
  //size(200, 200, P2D);
  size(200, 200, P3D);
}

void draw() {
  background(153);
  strokeWeight(10);
  ellipse(100, 100, 100, 100);
}

You can find a more detailed explanation including a guide on choosing the right mode at What is P3D?

like image 113
kraftner Avatar answered Apr 26 '23 20:04

kraftner