By default, OpenGL runs a fragment shader once for each pixel covered by a primitive being rasterized. When using multisampling, the outputs of that
fragment shader are broadcast to each covered sample of the fragment's pixel. When using multisampling, applications can also request that the fragment
shader be run once per color sample (when using the "sample" qualifier on one or more active fragment shader inputs), or run a fixed number of
times per pixel using SAMPLE_SHADING enable and the MinSampleShading frequency value. In all of these approaches, the number of fragment shader
invocations per pixel is fixed, based on API state.
This extension allows applications to bind and enable a shading rate image that can be used to vary the number of fragment shader invocations across
the framebuffer. This can be useful for applications like eye tracking for virtual reality, where the portion of the framebuffer that the user is
looking at directly can be processed at high frequency, while distant corners of the image can be processed at lower frequency. The shading rate image
is an immutable-format two-dimensional or two-dimensional array texture that uses a format of R8UI. Each texel represents a fixed-size rectangle in
the framebuffer, covering 16x16 pixels in the initial implementation of this extension. When rasterizing a primitive covering one of these rectangles,
the OpenGL implementation reads the texel in the bound shading rate image and looks up the fetched value in a palette of shading rates. The shading
rate used can vary from (finest) 16 fragment shader invocations per pixel to (coarsest) one fragment shader invocation for each 4x4 block of pixels.
When this extension is advertised by an OpenGL implementation, the implementation must also support the GLSL extension
"GL_NV_shading_rate_image" (documented separately), which provides new built-in variables that allow fragment shaders to determine the
effective shading rate used for each fragment. Additionally, the GLSL extension also provides new layout qualifiers allowing the interlock
functionality provided by ARB_fragment_shader_interlock to guarantee mutual exclusion across an entire fragment when the shading rate specifies
multiple pixels per fragment shader invocation.
Note that this extension requires the use of a framebuffer object; the shading rate image and related state are ignored when rendering to the default framebuffer.
Requires OpenGL 4. and NV_framebuffer_mixed_samples.
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public static native void | |
| public static void | |
| public static void | glGetShadingRateImagePaletteNV(int viewport, int entry, int[] rate)
Array version of: |
| public static void | |
| public static void | glGetShadingRateSampleLocationivNV(int rate, int samples, int index, int[] location)
Array version of: |
| public static native void | |
| public static void | |
| public static void | glShadingRateImagePaletteNV(int viewport, int first, int[] rates)
Array version of: |
| public static void | |
| public static void | glShadingRateSampleOrderCustomNV(int rate, int samples, int[] locations)
Array version of: |
| public static native void | |
| public static native void | |
| public static native void | |
| public static native void | |
| public static native void |
| GL_MAX_COARSE_FRAGMENT_SAMPLES_NV | back to summary |
|---|---|
| public static final int GL_MAX_COARSE_FRAGMENT_SAMPLES_NV Accepted by the | |
| GL_SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV | back to summary |
|---|---|
| public static final int GL_SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV Accepted in the | |
| GL_SHADING_RATE_1_INVOCATION_PER_1X2_PIXELS_NV | back to summary |
|---|---|
| public static final int GL_SHADING_RATE_1_INVOCATION_PER_1X2_PIXELS_NV Accepted in the | |
| GL_SHADING_RATE_1_INVOCATION_PER_2X1_PIXELS_NV | back to summary |
|---|---|
| public static final int GL_SHADING_RATE_1_INVOCATION_PER_2X1_PIXELS_NV Accepted in the | |
| GL_SHADING_RATE_1_INVOCATION_PER_2X2_PIXELS_NV | back to summary |
|---|---|
| public static final int GL_SHADING_RATE_1_INVOCATION_PER_2X2_PIXELS_NV Accepted in the | |
| GL_SHADING_RATE_1_INVOCATION_PER_2X4_PIXELS_NV | back to summary |
|---|---|
| public static final int GL_SHADING_RATE_1_INVOCATION_PER_2X4_PIXELS_NV Accepted in the | |
| GL_SHADING_RATE_1_INVOCATION_PER_4X2_PIXELS_NV | back to summary |
|---|---|
| public static final int GL_SHADING_RATE_1_INVOCATION_PER_4X2_PIXELS_NV Accepted in the | |
| GL_SHADING_RATE_1_INVOCATION_PER_4X4_PIXELS_NV | back to summary |
|---|---|
| public static final int GL_SHADING_RATE_1_INVOCATION_PER_4X4_PIXELS_NV Accepted in the | |
| GL_SHADING_RATE_1_INVOCATION_PER_PIXEL_NV | back to summary |
|---|---|
| public static final int GL_SHADING_RATE_1_INVOCATION_PER_PIXEL_NV Accepted in the | |
| GL_SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV | back to summary |
|---|---|
| public static final int GL_SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV Accepted in the | |
| GL_SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV | back to summary |
|---|---|
| public static final int GL_SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV Accepted in the | |
| GL_SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV | back to summary |
|---|---|
| public static final int GL_SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV Accepted in the | |
| GL_SHADING_RATE_IMAGE_BINDING_NV | back to summary |
|---|---|
| public static final int GL_SHADING_RATE_IMAGE_BINDING_NV Accepted by the | |
| GL_SHADING_RATE_IMAGE_NV | back to summary |
|---|---|
| public static final int GL_SHADING_RATE_IMAGE_NV Accepted by the | |
| GL_SHADING_RATE_IMAGE_PALETTE_SIZE_NV | back to summary |
|---|---|
| public static final int GL_SHADING_RATE_IMAGE_PALETTE_SIZE_NV Accepted by the | |
| GL_SHADING_RATE_IMAGE_TEXEL_HEIGHT_NV | back to summary |
|---|---|
| public static final int GL_SHADING_RATE_IMAGE_TEXEL_HEIGHT_NV Accepted by the | |
| GL_SHADING_RATE_IMAGE_TEXEL_WIDTH_NV | back to summary |
|---|---|
| public static final int GL_SHADING_RATE_IMAGE_TEXEL_WIDTH_NV Accepted by the | |
| GL_SHADING_RATE_NO_INVOCATIONS_NV | back to summary |
|---|---|
| public static final int GL_SHADING_RATE_NO_INVOCATIONS_NV Accepted in the | |
| GL_SHADING_RATE_SAMPLE_ORDER_DEFAULT_NV | back to summary |
|---|---|
| public static final int GL_SHADING_RATE_SAMPLE_ORDER_DEFAULT_NV Accepted by the | |
| GL_SHADING_RATE_SAMPLE_ORDER_PIXEL_MAJOR_NV | back to summary |
|---|---|
| public static final int GL_SHADING_RATE_SAMPLE_ORDER_PIXEL_MAJOR_NV Accepted by the | |
| GL_SHADING_RATE_SAMPLE_ORDER_SAMPLE_MAJOR_NV | back to summary |
|---|---|
| public static final int GL_SHADING_RATE_SAMPLE_ORDER_SAMPLE_MAJOR_NV Accepted by the | |
| NVShadingRateImage | back to summary |
|---|---|
| protected NVShadingRateImage() | |
| glBindShadingRateImageNV | back to summary |
|---|---|
| public static native void glBindShadingRateImageNV(int texture) | |
| glGetShadingRateImagePaletteNV | back to summary |
|---|---|
| public static void glGetShadingRateImagePaletteNV(int viewport, int entry, IntBuffer rate) | |
| glGetShadingRateImagePaletteNV | back to summary |
|---|---|
| public static void glGetShadingRateImagePaletteNV(int viewport, int entry, int[] rate) Array version of: | |
| glGetShadingRateSampleLocationivNV | back to summary |
|---|---|
| public static void glGetShadingRateSampleLocationivNV(int rate, int samples, int index, IntBuffer location) | |
| glGetShadingRateSampleLocationivNV | back to summary |
|---|---|
| public static void glGetShadingRateSampleLocationivNV(int rate, int samples, int index, int[] location) Array version of: | |
| glShadingRateImageBarrierNV | back to summary |
|---|---|
| public static native void glShadingRateImageBarrierNV(boolean synchronize) | |
| glShadingRateImagePaletteNV | back to summary |
|---|---|
| public static void glShadingRateImagePaletteNV(int viewport, int first, IntBuffer rates) | |
| glShadingRateImagePaletteNV | back to summary |
|---|---|
| public static void glShadingRateImagePaletteNV(int viewport, int first, int[] rates) Array version of: | |
| glShadingRateSampleOrderCustomNV | back to summary |
|---|---|
| public static void glShadingRateSampleOrderCustomNV(int rate, int samples, IntBuffer locations) | |
| glShadingRateSampleOrderCustomNV | back to summary |
|---|---|
| public static void glShadingRateSampleOrderCustomNV(int rate, int samples, int[] locations) Array version of: | |
| glShadingRateSampleOrderNV | back to summary |
|---|---|
| public static native void glShadingRateSampleOrderNV(int order) | |
| nglGetShadingRateImagePaletteNV | back to summary |
|---|---|
| public static native void nglGetShadingRateImagePaletteNV(int viewport, int entry, long rate) | |
| nglGetShadingRateSampleLocationivNV | back to summary |
|---|---|
| public static native void nglGetShadingRateSampleLocationivNV(int rate, int samples, int index, long location) | |
| nglShadingRateImagePaletteNV | back to summary |
|---|---|
| public static native void nglShadingRateImagePaletteNV(int viewport, int first, int count, long rates) | |
| nglShadingRateSampleOrderCustomNV | back to summary |
|---|---|
| public static native void nglShadingRateSampleOrderCustomNV(int rate, int samples, long locations) | |