This visual currently only uses a basic triangle underlying graphics. It performs a triangulation of the polygons with the earcut C++ library by mapbox. Several arbitrary-sized polygons can be specified in the same visual.
Automatic computation of normals (cross product of face vertices) if the normal prop is not provided
Props
Type
Index
Type
Description
pos
0
dvec3
vertex position
normal
0
vec3
vertex normal
texcoords
0
vec2
texture coordinates
color
0
cvec4
color as RGB 3-bytes
alpha
0
char
alpha transparency value
index
0
uint32
faces, as vertex indices
light_pos
0
mat4
light positions (uniform)
light_params
0
mat4
light coefficients (uniform)
texcoefs
0
vec4
texture blending coefficients (uniform)
clip
0
vec4
clip vector (uniform)
Warning
The texcoords and color props are mutually exclusive. The color has precedence over the texcoords. The mesh vertex struct has no color field, only a texcoord field. When the color prop is set, special texcoords values are computed (packing 3 bytes into the second texture coordinate floating-point number).
In a given visual, a prop is entirely defined by its type and its index. A visual may have multiple props of the same type. For example, the segment visual has a first prop pos with the segment start position, and another with the segment end position. The tables below specify the role of these indices in each case.
A visual source corresponds to a GPU object holding the data for the visual. Common source types include: vertex buffer, index buffer, uniform buffer, texture. In a given visual, a source is entirely defined by its type and its index. Each prop is typically linked to a given source. Most props correspond either to shader attributes, in which case they are associated with the vertex buffer, or to global variables, in which case they are associated with uniform buffers.
A visual is composed of one or several pipelines: graphics pipelines (or just graphics), and optionally compute pipelines (or just computes). A graphics pipeline corresponds to a vertex shader, a fragment shader, and possibly other shaders. In a given visual, each pipeline is entirely defined by its type (graphics or compute) and its index. The tables below specify the different pipelines when there are several of them in a given visual. For example, the axes visual contains a segment graphics for tick segments, and a text graphics for tick labels.
Props marked uniform below can only receive a single value. They correspond to struct fields in a uniform buffer, and they are thus shared across all vertices of a given visual.