gl_Position — 現在の頂点の位置が含まれています
gl_Position は
下記 gl_PerVertex のメンバーす。
out gl_PerVertex {
vec4 gl_Position;
float gl_PointSize;
float gl_ClipDistance[];
};
頂点、テッセレーション評価、ジオメトリーの言語に於いて、
gl_PerVertex という名前の単一のグローバルインスタンスが使用可能であり、
そのメンバーである gl_Position は受け取った同種の頂点位置を受け取って出力します。
シェーダー実行中にいつでも書き込めます。
gl_Position に書き込まれた値は、
プリミティブアセンブリ及びクリッピング、カリング、頂点処理が発生した後、
プリミティブを操作するその他の固定機能が存在すればその操作で使用されます。
In the tessellation control language, the gl_PerVertex named block
is used to construct an array, gl_out[], whose gl_Position
members hold the homogeneous control point position, which become available as inputs to the subsequent
tessellation evaluation shader.
The value of gl_Position (or the gl_Position member of the gl_out[]
array, in the case of the tessellation control shader)
is undefined after the vertex, tessellation control, and tessellation evaluation
shading stages if the corresponding shader executable does
not write to gl_Position. It is also undefined after the geometry processing stage if the geometry shader executable calls
EmitVertex without having
written gl_Position since the last call to EmitVertex
(or hasn't written it at all).
In the tessellation control, tessellation evaluation and geometry languages,
the gl_PerVertex named block is used to construct an array, gl_in[]
of per-vertex or per-control point inputs whose content represents the corresponding
outputs written by the previous stage.
| OpenGL Shading Language Version | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Function Name | 1.10 | 1.20 | 1.30 | 1.40 | 1.50 | 3.30 | 4.00 | 4.10 | 4.20 | 4.30 | 4.40 | 4.50 |
| gl_Position | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
Versions 1.10 to 1.40 - vertex shader only.
Versions 1.50 to 3.30 - vertex and geometry shaders only.
Copyright © 2011-2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.