Geometry Shader/Defined Inputs: Difference between revisions
Jump to navigation
Jump to search
Renaming "rendering command" to "drawing command", in accordance with the specification's distinction. |
No edit summary |
||
(One intermediate revision by one other user not shown) | |||
Line 16: | Line 16: | ||
<source lang="glsl"> | <source lang="glsl"> | ||
in int gl_PrimitiveIDIn; | in int gl_PrimitiveIDIn; | ||
in int gl_InvocationID; | in int gl_InvocationID; // Requires GLSL 4.0 or ARB_gpu_shader5 | ||
</source> | </source> | ||
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]]. |
Latest revision as of 14:06, 3 January 2018
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.