smooth()

Environment

Description

Draws all geometry with smooth (anti-aliased) edges. Enabled by default.

Syntax

void smooth()

Parameters

None

Returns

void

Related

Under the Hood

From Processing.h:

void smooth(int level = 2);

Under the Hood

From Processing.cpp:

void PApplet::smooth(int level) { // The MAIN window's actual MSAA sample count is fixed at window-creation // time (GLFW_SAMPLES is a window hint, can't change after the window // exists) -- so smooth(level) can't retroactively change the main // canvas's hardware sample count the way real Processing's P2D/P3D // renderers can. What we CAN do: store the requested level (used by // PGraphics buffers below, which DO get to choose their own sample // count fresh at creation time), and toggle the same smoothing flags // smooth() always has, regardless of which level was requested. smoothing = true; smoothLevel = level; glEnable(GL_LINE_SMOOTH);glHint(GL_LINE_SMOOTH_HINT,GL_NICEST); glEnable(GL_POINT_SMOOTH);glHint(GL_POINT_SMOOTH_HINT,GL_NICEST); glEnable(GL_MULTISAMPLE); } smooth();