Skip to content

Graphics library

This page lists all included graphics. The list is divided into:

  • 2D graphics: high-quality antialiased 2D graphical elements,
  • 3D graphics: meshes and volumes,
  • Basic graphics: basic, low-quality, aliased, but fast basic primitives (points, lines, triangles), useful for demo, testing, and when dealing with tens of millions of points


If not specified, the default vertex structure is DvzVertex:

Field Type Description
pos vec3 position
color cvec4 color RGBA (four bytes)

2D graphics



Field Type Description
pos vec3 position
color cvec4 color
size float marker size, in pixels
marker uint8_t marker type enum
angle uint8_t angle, between 0 (0) included and 256 (M_2PI) excluded
transform uint8_t transform enum


Field Type Description
edge_color vec4 edge color RGBA
edge_width float line width, in pixels



Field Type Description
P0 vec3 start position
P1 vec3 end position
shift vec4 shift of start (xy) and end (zw) positions, in pixels
color cvec4 color
linewidth float line width, in pixels
cap0 DvzCapType start cap enum
cap1 DvzCapType end cap enum
transform uint8_t transform enum



Field Type Description
p0 vec3 previous position
p1 vec3 current position
p2 vec3 next position
p3 vec3 next next position
color cvec4 point color


Field Type Description
linewidth float line width in pixels
miter_limit float miter limit for joins
cap_type int32_t type of the ends of the path
round_join int32_t whether to use round joins



Field Type Description
vertex DvzGraphicsTextVertex text vertex
glyph_colors cvec4* glyph colors
font_size float font size
string const char* text string


Field Type Description
pos vec3 position
shift vec2 shift, in pixels
color cvec4 color
glyph_size vec2 glyph size, in pixels
anchor vec2 character anchor, in normalized coordinates
angle float string angle
glyph usvec4 glyph: char code, char index, string length, string index
transform uint8_t transform enum


Field Type Description
grid_size ivec2 font atlas grid size (rows, columns)
tex_size ivec2 font atlas texture size, in pixels



Field Type Description
pos0 vec3 top left corner
pos1 vec3 top right corner
pos2 vec3 bottom right corner
pos3 vec3 bottom left corner
uv0 vec2 tex coords of the top left corner
uv1 vec2 tex coords of the top right corner
uv2 vec2 tex coords of the bottom right corner
uv3 vec2 tex coords of the bottom left corner


Field Type Description
pos vec3 position
uv vec2 tex coordinates


Field Type Description
tex_coefs vec4 blending coefficients for the four images

3D graphics



Field Type Description
pos vec4 position
normal vec4 normal vector
uv vec2 tex coords
alpha uint8_t transparency value


Field Type Description
lights_pos_0 mat4 positions of each of the maximum four lights
lights_params_0 mat4 ambient, diffuse, specular coefs for each light
tex_coefs vec4 blending coefficients for the four textures
clip_coefs vec4 clip coefficients

The mesh graphics supports the following features:

  • Phong shading
  • Up to four textures
  • Customizable texture blending coefficients
  • Transparency (but does not play well with depth test)
  • Support for arbitrary RGB values (via cvec3 packing into vec2)
  • Customizable plane clipping

Plane clipping: when the clip vector is non-zero, the fragment shader implements the following test. If the dot product of the clip vector with the vertex position (in scene coordinates) is negative, the fragment is discarded. This feature allows to cut the mesh along any arbitrary affine plane.

Basic graphics



Field Type Description
point_size float point size, in pixels


Line strip


Triangle strip

Triangle fan


Triangle fan graphics is not supported on macOS and should therefore be avoided if macOS compatibility is desirable.