czm_viewport

czm_viewport

An automatic GLSL uniform containing the viewport's x, y, width, and height properties in an vec4's x, y, z, and w components, respectively.

Example
// GLSL declaration
uniform vec4 czm_viewport;

// Scale the window coordinate components to [0, 1] by dividing
// by the viewport's width and height.
vec2 v = gl_FragCoord.xy / czm_viewport.zw;
See:
  • Context#getViewport
Source: