Difference between revisions of "Geometry Shader/Defined Inputs"
Jump to navigation
Jump to search
(Renaming "rendering command" to "drawing command", in accordance with the specification's distinction.) |
m (Bot: Updating section links to use redirects.) |
||
Line 22: | Line 22: | ||
: the current input primitive's ID, based on the number of primitives processed by the GS since the current drawing command started. | : the current input primitive's ID, based on the number of primitives processed by the GS since the current drawing command started. | ||
; {{code|gl_InvocationID}} | ; {{code|gl_InvocationID}} | ||
− | : the current instance, as defined when [[Geometry Shader | + | : the current instance, as defined when [[Geometry Shader Instancing|instancing geometry shaders]]. |
Revision as of 16:37, 6 May 2015
Geometry Shaders provide the following built-in input variables:
in gl_PerVertex
{
vec4 gl_Position;
float gl_PointSize;
float gl_ClipDistance[];
} gl_in[];
These variables have only the meaning the prior shader stage(s) that passed them gave them.
There are some GS input values that are based on primitives, not vertices. These are not aggregated into arrays. These are:
in int gl_PrimitiveIDIn;
in int gl_InvocationID; //Requires GLSL 4.0 or ARB_gpu_shader5
- gl_PrimitiveIDIn
- the current input primitive's ID, based on the number of primitives processed by the GS since the current drawing command started.
- gl_InvocationID
- the current instance, as defined when instancing geometry shaders.