Vertex shader
Runs 3 times, once per vertex. Each run turns the vertex's attributes into a clip-space position.
| Run | a_position | a_color | gl_Position.xy |
|---|
The vertex shader runs once per vertex. The rasterizer then works out which pixels the triangle covers and blends each vertex's outputs for them. The fragment shader runs once for every one of those pixels. Drag the vertices, shrink the image, and hover a pixel.
This browser does not support WebGL2.
Runs 3 times, once per vertex. Each run turns the vertex's attributes into a clip-space position.
| Run | a_position | a_color | gl_Position.xy |
|---|
Finds the pixels whose centers fall inside the triangle and blends the vertex shader's
out values for each. Fragments created:
.
Runs once per covered pixel. The values it receives are blended, not copied from a vertex.