Pixels
Pixels
¶
Pixels are the smallest entities that can be rendered on screen (pixel or fragment) or on paper (dot). They can be colored but have no dimension and correspond to the true mathematical notion of a point.
IN/OUT variables
// Rendering stage 1
in uniform vec4 viewport; // in("viewport")
in attribute [ vec2 | vec3 ] positions; // in("positions")
in [ attribute | uniform ] vec4 colors; // in("colors")
// Rendering stage 2
out attribute vec3 screen; // out("screen[positions]")
// Rendering stage 3
out attribute vec4 colors; // out("colors")
Example
Create a Pixels visual at given positions and given colors. If positions is a transform, it is first evaluated and produce the "screen" and "depth" buffers. If the type of positions is vec2, the z coordinate of all pixels is set to the default z coordinate (0). If colors is a transform, it is first evaluated and produce the "colors" buffer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
positions |
Transform | Buffer
|
Pixel positions (vec3 or vec2) |
required |
colors |
Transform | Buffer | Color
|
Pixel colors (vec4) |
required |
render
¶
Render the visual on viewport using the given model, view, proj matrices
Parameters:
Name | Type | Description | Default |
---|---|---|---|
viewport |
Viewport
|
Viewport where to render the visual |
required |
model |
mat4
|
Model matrix to use for rendering |
None
|
view |
mat4
|
View matrix to use for rendering |
None
|
proj |
mat4
|
Projection matrix to use for rendering |
None
|