czm_viewportOrthographic

czm_viewportOrthographic

An automatic GLSL uniform representing a 4x4 orthographic projection matrix that transforms window coordinates to clip coordinates. Clip coordinates is the coordinate system for a vertex shader's gl_Position output.

This transform is useful when a vertex shader inputs or manipulates window coordinates as done by BillboardCollection.

Do not confuse czm_viewportTransformation with czm_viewportOrthographic. The former transforms from normalized device coordinates to window coordinates; the later transforms from window coordinates to clip coordinates, and is often used to assign to gl_Position.

Like all automatic uniforms, czm_viewportOrthographic does not need to be explicitly declared. However, it can be explicitly declared when a shader is also used by other applications such as a third-party authoring tool.

Example
// GLSL declaration
uniform mat4 czm_viewportOrthographic;

// Example
gl_Position = czm_viewportOrthographic * vec4(windowPosition, 0.0, 1.0);
See:
Source: