This extension also provides a mechanism to render VR scenes at a non-uniform resolution, in particular a resolution that falls linearly from the center towards the edges. This is achieved by scaling the "w" coordinate of the vertices in the clip space before perspective divide. The clip space "w" coordinate of the vertices may be offset as of a function of "x" and "y" coordinates as follows:
w' = w + Ax + By
In the intended use case for viewport position scaling, an application should use a set of 4 viewports, one for each of the 4 quadrants of a Cartesian coordinate system. Each viewport is set to the dimension of the image, but is scissored to the quadrant it represents. The application should specify A and B coefficients of the w-scaling equation above, that have the same value, but different signs, for each of the viewports. The signs of A and B should match the signs of X and Y for the quadrant that they represent such that the value of "w'" will always be greater than or equal to the original "w" value for the entire image. Since the offset to "w", (Ax + By), is always positive and increases with the absolute values of "x" and "y", the effective resolution will fall off linearly from the center of the image to its edges.
Requires NV_viewport_array or OES_viewport_array.
| Modifier and Type | Field and Description |
|---|---|
| public static final int | GL_VIEWPORT_POSITION_W_SCALE_NV
Accepted by the |
| public static final int | GL_VIEWPORT_POSITION_W_SCALE_X_COEFF
Accepted by the |
| public static final int | GL_VIEWPORT_POSITION_W_SCALE_Y_COEFF
Accepted by the |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public static native void | glViewportPositionWScaleNV(int
the viewport index index, float the x coefficient xcoeff, float the y coefficient ycoeff)If
|
| GL_VIEWPORT_POSITION_W_SCALE_NV | back to summary |
|---|---|
| public static final int GL_VIEWPORT_POSITION_W_SCALE_NV Accepted by the | |
| GL_VIEWPORT_POSITION_W_SCALE_X_COEFF | back to summary |
|---|---|
| public static final int GL_VIEWPORT_POSITION_W_SCALE_X_COEFF Accepted by the | |
| GL_VIEWPORT_POSITION_W_SCALE_Y_COEFF | back to summary |
|---|---|
| public static final int GL_VIEWPORT_POSITION_W_SCALE_Y_COEFF Accepted by the | |
| NVClipSpaceWScaling | back to summary |
|---|---|
| protected NVClipSpaceWScaling() | |
| glViewportPositionWScaleNV | back to summary |
|---|---|
| public static native void glViewportPositionWScaleNV(int index, float xcoeff, float ycoeff) If
The coefficients for "x" and "y" used in the above equation depend on the viewport index, and are controlled by this command. The viewport specified by
| |