Painter Types

From K-3D

Jump to: navigation, search

Current Painters

Reference Implementation Painters

The Reference Implementation painters provide lowest-common-denominator functionality that uses minimal OpenGL / hardware functionality.

VBO Painters

The VBO painters use OpenGL vertex buffer objects for superior drawing performance. Common functionality is provided by vbo.h

Special-Purpose Painters

Flat or Smooth Shading

The default OpenGLFacePainter painter and the FacePainterFlatNormals painter render polygon faces using flat shading. FacePainterSmoothNormals renders all faces using smooth shading. FacePainterAutoNormals chooses the shading for each face based on the relative directions of the face normals. Below is an illustration of, from left to right, FacePainterFlatNormals, FacePainterSmoothNormals and FacePainterAutoNormals.


Edge Shading

"Edge Shading" refers to user-controllable per-polyhedron-edge shading where the user designates an edge as "hard" or "soft". "Soft" edges are automatically smooth-shaded while "hard" edges are not. The data can be stored as a per-edge array of floating-point values, where each value encodes the maximum angle between adjacent faces. The corresponding painter tests the angle of each pair of adjacent faces, smooth-shading them if it is below the threshold.

Per-Vertex Normals

Many file formats support specification of normals on a per-vertex basis, and this is how normals can be overridden in RenderMan. Per-vertex normals can be stored as either per-point or per-edge arrays of k3d::normal objects. For consistency with RenderMan, the array name should be "N". The corresponding painter simply uses the array data when rendering.

Per-Vertex Color

Per-vertex color can be stored in per-point or per-edge arrays of k3d::color objects named "Cs".

Per-Vertex Opacity

Per-vertex opacity can be stored in per-point or per-edge arrays of k3d::color objects named "Os".

Personal tools