OpenGL is modeled on a pipeline of operations. The final stage in this pipeline before rasterization is the viewport transformation. This stage transforms vertices from view space into window coordinates and allows the application to specify a rectangular region of screen space into which OpenGL should draw primitives. Unextended OpenGL implementations provide a single viewport per context. In order to draw primitives into multiple viewports, the OpenGL viewport may be changed between several draw calls. With the advent of Geometry Shaders, it has become possible for an application to amplify geometry and produce multiple output primitives for each primitive input to the Geometry Shader. It is possible to direct these primitives to render into a selected render target. However, all render targets share the same, global OpenGL viewport.
This extension enhances OpenGL by providing a mechanism to expose multiple viewports. Each viewport is specified as a rectangle. The destination viewport may be selected per-primitive by the geometry shader. This allows the Geometry Shader to produce different versions of primitives destined for separate viewport rectangles on the same surface. Additionally, when combined with multiple framebuffer attachments, it allows a different viewport rectangle to be selected for each. This extension also exposes a separate scissor rectangle for each viewport. Finally, the viewport bounds are now floating point quantities allowing fractional pixel offsets to be applied during the viewport transform.
Requires OpenGL 3. or EXT_geometry_shader4 or ARB_geometry_shader4. Promoted to core in OpenGL 4..
| Modifier and Type | Field and Description |
|---|---|
| public static final int | GL_LAYER_PROVOKING_VERTEX
Accepted by the |
| public static final int | GL_MAX_VIEWPORTS
Accepted by the |
| public static final int | GL_UNDEFINED_VERTEX
Returned in the |
| public static final int | GL_VIEWPORT_BOUNDS_RANGE
Accepted by the |
| public static final int | GL_VIEWPORT_INDEX_PROVOKING_VERTEX
Accepted by the |
| public static final int | GL_VIEWPORT_SUBPIXEL_BITS
Accepted by the |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public static void | glDepthRangeArrayv(int
the index of the first viewport whose depth range to update first, DoubleBuffer n array containing the near and far values for the depth range of each modified viewport v)Specifies mapping of depth values from normalized device coordinates to window coordinates for a specified set of viewports. |
| public static void | |
| public static void | glDepthRangeIndexed(int
the index of the viewport whose depth range to update index, double the mapping of the near clipping plane to window coordinates. The initial value is 0. zNear, double the mapping of the far clipping plane to window coordinates. The initial value is 1. zFar)Specifies mapping of depth values from normalized device coordinates to window coordinates for a specified viewport. |
| public static double | glGetDoublei(int
the indexed state to query target, int the index of the element being queried index)Queries the double value of an indexed state variable. |
| public static void | glGetDoublei_v(int
the indexed state to query target, int the index of the element being queried index, DoubleBuffer a scalar or buffer in which to place the returned data data)Queries the double value of an indexed state variable. |
| public static void | |
| public static float | glGetFloati(int
the indexed state to query target, int the index of the element being queried index)Queries the float value of an indexed state variable. |
| public static void | glGetFloati_v(int
the indexed state to query target, int the index of the element being queried index, FloatBuffer a scalar or buffer in which to place the returned data data)Queries the float value of an indexed state variable. |
| public static void | |
| public static void | glScissorArrayv(int
the index of the first viewport whose scissor box to modify first, IntBuffer an array containing the left, bottom, width and height of each scissor box, in that order v)Defines the scissor box for multiple viewports. |
| public static void | |
| public static void | glScissorIndexed(int
the index of the viewport whose scissor box to modify index, int the left scissor box coordinate left, int the bottom scissor box coordinate bottom, int the scissor box width width, int the scissor box height height)Defines the scissor box for a specific viewport. |
| public static void | glScissorIndexedv(int
the index of the viewport whose scissor box to modify index, IntBuffer an array containing the left, bottom, width and height of each scissor box, in that order v)Pointer version of |
| public static void | |
| public static void | glViewportArrayv(int
the first viewport to set first, FloatBuffer an array containing the viewport parameters v)Sets multiple viewports. |
| public static void | |
| public static void | glViewportIndexedf(int
the viewport to set index, float the left viewport coordinate x, float the bottom viewport coordinate y, float the viewport width w, float the viewport height h)Sets a specified viewport. |
| public static void | glViewportIndexedfv(int
the viewport to set index, FloatBuffer the viewport parameters v)Pointer version of |
| public static void | |
| public static void | nglDepthRangeArrayv(int first, int
the number of viewports whose depth range to update count, long v)Unsafe version of: |
| public static void | |
| public static void | |
| public static void | nglScissorArrayv(int first, int
the number of scissor boxes to modify count, long v)Unsafe version of: |
| public static void | |
| public static void | nglViewportArrayv(int first, int
the number of viewports to set count, long v)Unsafe version of: |
| public static void |
| GL_LAYER_PROVOKING_VERTEX | back to summary |
|---|---|
| public static final int GL_LAYER_PROVOKING_VERTEX Accepted by the | |
| GL_MAX_VIEWPORTS | back to summary |
|---|---|
| public static final int GL_MAX_VIEWPORTS Accepted by the | |
| GL_UNDEFINED_VERTEX | back to summary |
|---|---|
| public static final int GL_UNDEFINED_VERTEX Returned in the | |
| GL_VIEWPORT_BOUNDS_RANGE | back to summary |
|---|---|
| public static final int GL_VIEWPORT_BOUNDS_RANGE Accepted by the | |
| GL_VIEWPORT_INDEX_PROVOKING_VERTEX | back to summary |
|---|---|
| public static final int GL_VIEWPORT_INDEX_PROVOKING_VERTEX Accepted by the | |
| GL_VIEWPORT_SUBPIXEL_BITS | back to summary |
|---|---|
| public static final int GL_VIEWPORT_SUBPIXEL_BITS Accepted by the | |
| ARBViewportArray | back to summary |
|---|---|
| protected ARBViewportArray() | |
| glDepthRangeArrayv | back to summary |
|---|---|
| public static void glDepthRangeArrayv(int first, DoubleBuffer v) Specifies mapping of depth values from normalized device coordinates to window coordinates for a specified set of viewports.
| |
| glDepthRangeArrayv | back to summary |
|---|---|
| public static void glDepthRangeArrayv(int first, double[] v) Array version of: | |
| glDepthRangeIndexed | back to summary |
|---|---|
| public static void glDepthRangeIndexed(int index, double zNear, double zFar) Specifies mapping of depth values from normalized device coordinates to window coordinates for a specified viewport.
| |
| glGetDoublei | back to summary |
|---|---|
| public static double glGetDoublei(int target, int index) Queries the double value of an indexed state variable.
| |
| glGetDoublei_v | back to summary |
|---|---|
| public static void glGetDoublei_v(int target, int index, DoubleBuffer data) Queries the double value of an indexed state variable.
| |
| glGetDoublei_v | back to summary |
|---|---|
| public static void glGetDoublei_v(int target, int index, double[] data) Array version of: | |
| glGetFloati | back to summary |
|---|---|
| public static float glGetFloati(int target, int index) Queries the float value of an indexed state variable.
| |
| glGetFloati_v | back to summary |
|---|---|
| public static void glGetFloati_v(int target, int index, FloatBuffer data) Queries the float value of an indexed state variable.
| |
| glGetFloati_v | back to summary |
|---|---|
| public static void glGetFloati_v(int target, int index, float[] data) Array version of: | |
| glScissorArrayv | back to summary |
|---|---|
| public static void glScissorArrayv(int first, IntBuffer v) Defines the scissor box for multiple viewports.
| |
| glScissorArrayv | back to summary |
|---|---|
| public static void glScissorArrayv(int first, int[] v) Array version of: | |
| glScissorIndexed | back to summary |
|---|---|
| public static void glScissorIndexed(int index, int left, int bottom, int width, int height) Defines the scissor box for a specific viewport.
| |
| glScissorIndexedv | back to summary |
|---|---|
| public static void glScissorIndexedv(int index, IntBuffer v) Pointer version of
| |
| glScissorIndexedv | back to summary |
|---|---|
| public static void glScissorIndexedv(int index, int[] v) Array version of: | |
| glViewportArrayv | back to summary |
|---|---|
| public static void glViewportArrayv(int first, FloatBuffer v) Sets multiple viewports.
| |
| glViewportArrayv | back to summary |
|---|---|
| public static void glViewportArrayv(int first, float[] v) Array version of: | |
| glViewportIndexedf | back to summary |
|---|---|
| public static void glViewportIndexedf(int index, float x, float y, float w, float h) Sets a specified viewport.
| |
| glViewportIndexedfv | back to summary |
|---|---|
| public static void glViewportIndexedfv(int index, FloatBuffer v) Pointer version of
| |
| glViewportIndexedfv | back to summary |
|---|---|
| public static void glViewportIndexedfv(int index, float[] v) Array version of: | |
| nglDepthRangeArrayv | back to summary |
|---|---|
| public static void nglDepthRangeArrayv(int first, int count, long v) Unsafe version of:
| |
| nglGetDoublei_v | back to summary |
|---|---|
| public static void nglGetDoublei_v(int target, int index, long data) Unsafe version of: | |
| nglGetFloati_v | back to summary |
|---|---|
| public static void nglGetFloati_v(int target, int index, long data) Unsafe version of: | |
| nglScissorArrayv | back to summary |
|---|---|
| public static void nglScissorArrayv(int first, int count, long v) Unsafe version of:
| |
| nglScissorIndexedv | back to summary |
|---|---|
| public static void nglScissorIndexedv(int index, long v) Unsafe version of: | |
| nglViewportArrayv | back to summary |
|---|---|
| public static void nglViewportArrayv(int first, int count, long v) Unsafe version of:
| |
| nglViewportIndexedfv | back to summary |
|---|---|
| public static void nglViewportIndexedfv(int index, long v) Unsafe version of: | |