Vertex Pulling
TODO: This article is a work-in-progress.
- Normal vertex-streaming does not support per-face data.
- Pulling from a vertex-stream or SSBO/UBO is generally the same speed.
- Vertex-shaders only have to emit a NDC-position; how they do so is undefined.
- Vertices can be defined via vertex- and index-array within a vertex-shader.
Implementation
TODO: Detailed implementation and/or guide?
- Upload tightly-packed vertices to a GPU-side buffer, accessible by a vertex shader.
- Pull vertices from that buffer in the vertex-shader, based on the current vertex ID /
gl_VertexID
.
References
- Vertex Formats Part 2: Fetch vs Pull (recommended)
- Programmable Vertex Pulling by hannomalie
- Programmable Vertex Pulling by ktstephano
- Dynamic Vertex Pulling with D3D11
- WebGL Pulling Vertices
Note: Uses textures instead of buffers. nlguillemot/ProgrammablePulling
superdump/bevy-vertex-pulling