4

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

stuckoverflow
  • 625
  • 2
  • 7
  • 23
CatsLoveJazz
  • 829
  • 1
  • 16
  • 35

1 Answers1

7

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

default P2D P3D

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?

kraftner
  • 467
  • 2
  • 19
  • Thanks @kraftner. What exactly does "accuracy" mean in relation to render mode. Will this effect how pixelated a circle would appear or anti-aliasing for example? – CatsLoveJazz Apr 02 '14 at 11:52
  • That is a good example. You should easily see this if you just try with a simple sketch. – kraftner Apr 02 '14 at 11:57
  • Thanks I will do when I get home. The reason I was asking is because I have a sketch where it looks like anti-aliasing is creeping in with the default (i.e. none specified) 'accurate' render mode. Is there anything else I can do to combat this? – CatsLoveJazz Apr 02 '14 at 12:05
  • Also is there any other issues I should be aware of using OPENGL such as rendering differently on different systems? – CatsLoveJazz Apr 02 '14 at 12:06
  • Concerning anti-aliasing this should be a different question, but have a look at [smooth()](http://processing.org/reference/smooth_.html) – kraftner Apr 02 '14 at 12:17
  • I have a smooth(8) call after size() but am still seeing artifacts on a number of lines, looks like I will have to work backwards to find out where the issue creeps in. – CatsLoveJazz Apr 02 '14 at 12:24
  • Just to be clear, the render mode does not impact anti-aliasing but the default renderer will result in less accurate/pixelated lines. – CatsLoveJazz Apr 02 '14 at 12:26