
Programmable Vertex Pulling
Daniel R
´
akos
21.1 Introduction
OpenGL and today’s GPUs provide a high degree of flexibility for acquiring
geometry-related information from auxiliary buffers using the shader built-in con-
stants provided by GLSL based on data granularity. The name gl
VertexID pro-
vides the index of the currently processed vertex, gl
PrimitiveID,whichprovides
the index of the currently processed geometric primitive, and gl
InstanceID pro-
vides the index of the currently processed instance of an instanced draw command.
Still, there are restrictions on how object information can be passed to the graphics
pipeline if we use traditional methods ...