Top Description Fields Constructors Methods
org.lwjgl.opengl

public Class ARBSampleLocations

extends Object
Class Inheritance
Imports
java.nio.*, org.lwjgl.system.*

Native bindings to the ARB_sample_locations extension.

This extension allows an application to modify the locations of samples within a pixel used in multisample rasterization. Additionally, it allows applications to specify different sample locations for each pixel in a group of adjacent pixels, which may increase antialiasing quality (particularly if a custom resolve shader is used that takes advantage of these different locations).

It is common for implementations to optimize the storage of depth values by storing values that can be used to reconstruct depth at each sample location, rather than storing separate depth values for each sample. For example, the depth values from a single triangle can be represented using plane equations. When the depth value for a sample is needed, it is automatically evaluated at the sample location. Modifying the sample locations causes the reconstruction to no longer evaluate the same depth values as when the samples were originally generated. This extension provides a command to "evaluate" and store per-sample depth values using the currently programmed sample locations, which allows the application to manage this issue if/when necessary.

The programmable sample locations are used during rasterization and for evaluation of depth functions during normal geometric rendering. The programmable locations are associated with a framebuffer object rather than an individual depth buffer, so if the depth buffer is used as a texture the texture sampling may be done at the standard sample locations. Additionally, commands that do not render geometric primitives (e.g. ReadPixels, BlitFramebuffer, CopyTexSubImage2D, etc.) may use the standard sample locations to evaluate depth functions rather than the programmable locations. If a single depth buffer is used at different times with different sample locations, the depth functions may be interpreted using the current sample locations.

Field Summary

Modifier and TypeField and Description
public static final int
public static final int
public static final int
GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARB

Accepted by the pname parameter of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev.

public static final int
GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_ARB

Accepted by the pname parameter of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev.

public static final int
GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_ARB

Accepted by the pname parameter of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev.

public static final int
GL_SAMPLE_LOCATION_SUBPIXEL_BITS_ARB

Accepted by the pname parameter of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static native void
glEvaluateDepthValuesARB()

Evaluates depth values for all samples in the current depth buffer (subject to the pixel ownership and scissor tests) and stores each value in the depth buffer.

public static void
glFramebufferSampleLocationsfvARB(int
the framebuffer target. One of:
FRAMEBUFFERDRAW_FRAMEBUFFERREAD_FRAMEBUFFER
target
,
int
the first sample location to update
start
,
FloatBuffer
a pair of values for each sample location to update
v
)

Controls the programmable sample locations for the framebuffer bound to the specified target.

public static void
glFramebufferSampleLocationsfvARB(int target, int start, float[] v)

Array version of: FramebufferSampleLocationsfvARB

public static void
glNamedFramebufferSampleLocationsfvARB(int
the framebuffer object to update
framebuffer
,
int
the first sample location to update
start
,
FloatBuffer
a pair of values for each sample location to update
v
)

DSA version of FramebufferSampleLocationsfvARB.

public static void
glNamedFramebufferSampleLocationsfvARB(int framebuffer, int start, float[] v)

Array version of: NamedFramebufferSampleLocationsfvARB

public static native void
nglFramebufferSampleLocationsfvARB(int target, int start, int
the number of sample locations to update
count
,
long v)

Unsafe version of: FramebufferSampleLocationsfvARB

public static native void
nglNamedFramebufferSampleLocationsfvARB(int framebuffer, int start, int
the number of sample locations to update
count
,
long v)

Unsafe version of: NamedFramebufferSampleLocationsfvARB

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_ARBback to summary
public static final int GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_ARB

// Alias of SAMPLE_POSITION. Before NV_expms, the spec used "location". SAMPLE_LOCATION_ARB 0x8E50 PROGRAMMABLE_SAMPLE_LOCATION_ARB 0x9341 Accepted by the pname parameter of FramebufferParameteri, GetFramebufferParameteriv.

GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_ARBback to summary
public static final int GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_ARB

// Alias of SAMPLE_POSITION. Before NV_expms, the spec used "location". SAMPLE_LOCATION_ARB 0x8E50 PROGRAMMABLE_SAMPLE_LOCATION_ARB 0x9341 Accepted by the pname parameter of FramebufferParameteri, GetFramebufferParameteriv.

GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARBback to summary
public static final int GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARB

Accepted by the pname parameter of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev.

GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_ARBback to summary
public static final int GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_ARB

Accepted by the pname parameter of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev.

GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_ARBback to summary
public static final int GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_ARB

Accepted by the pname parameter of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev.

GL_SAMPLE_LOCATION_SUBPIXEL_BITS_ARBback to summary
public static final int GL_SAMPLE_LOCATION_SUBPIXEL_BITS_ARB

Accepted by the pname parameter of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev.

Constructor Detail

ARBSampleLocationsback to summary
protected ARBSampleLocations()

Method Detail

glEvaluateDepthValuesARBback to summary
public static native void glEvaluateDepthValuesARB()

Evaluates depth values for all samples in the current depth buffer (subject to the pixel ownership and scissor tests) and stores each value in the depth buffer. This can be used to ensure that later accesses will use depth values consistent with the sample locations used when the samples were generated. If the current framebuffer has no depth buffer, EvaluateDepthValuesARB will have no effect.

glFramebufferSampleLocationsfvARBback to summary
public static void glFramebufferSampleLocationsfvARB(int target, int start, FloatBuffer v)

Controls the programmable sample locations for the framebuffer bound to the specified target.

There are N pairs of programmable sample locations values in a framebuffer, where N is the value of PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARB. Each programmable sample location is specified as a pair of floating point values in the range [0,1], corresponding to the x and y locations respectively in GL pixel space. (0.5, 0.5) thus corresponds to the pixel center. Sample locations outside of [0,1] result in undefined behavior.

Parameters
target:int

the framebuffer target. One of:

FRAMEBUFFERDRAW_FRAMEBUFFERREAD_FRAMEBUFFER
start:int

the first sample location to update

v:FloatBuffer

a pair of values for each sample location to update

glFramebufferSampleLocationsfvARBback to summary
public static void glFramebufferSampleLocationsfvARB(int target, int start, float[] v)

Array version of: FramebufferSampleLocationsfvARB

glNamedFramebufferSampleLocationsfvARBback to summary
public static void glNamedFramebufferSampleLocationsfvARB(int framebuffer, int start, FloatBuffer v)

DSA version of FramebufferSampleLocationsfvARB.

Parameters
framebuffer:int

the framebuffer object to update

start:int

the first sample location to update

v:FloatBuffer

a pair of values for each sample location to update

glNamedFramebufferSampleLocationsfvARBback to summary
public static void glNamedFramebufferSampleLocationsfvARB(int framebuffer, int start, float[] v)

Array version of: NamedFramebufferSampleLocationsfvARB

nglFramebufferSampleLocationsfvARBback to summary
public static native void nglFramebufferSampleLocationsfvARB(int target, int start, int count, long v)

Unsafe version of: FramebufferSampleLocationsfvARB

Parameters
count:int

the number of sample locations to update

nglNamedFramebufferSampleLocationsfvARBback to summary
public static native void nglNamedFramebufferSampleLocationsfvARB(int framebuffer, int start, int count, long v)

Unsafe version of: NamedFramebufferSampleLocationsfvARB

Parameters
count:int

the number of sample locations to update