glTF

CESIUM_RTC

Contributors

Status

Stable

Dependencies

Written against the glTF draft 1.0 spec.

Overview

Massive world graphics applications have position vertex attributes with precision requirements that result in jittering artifacts when naively rendered with 32-bit floating-point values. This extension introduces the metadata required to implement the Relative To Center (RTC) high-precision rendering technique described by [Ohlarik08].

In this technique, each position is defined relative to an origin (the center) such that 32-bit floating-point precision is adequate to describe the distance between each position and the center. These relative positions are stored in the glTF vertex data. At runtime, the positions are transformed with a modified model-view matrix that makes the center relative to the eye. This avoids 32-bit subtraction of large translation components on the GPU.

glTF Schema Updates

This extension adds:

Listing 1: Computing the RTC model-view matrix.

// Transform the RTC center point into eye coordinates using double-precision on the CPU
var viewMatrix = new Matrix4(/* ... */);
var rtcCenter = new Cartesian3(/* ... */);
var rtcCenterEye = new Cartesian3();
Matrix4.multiplyByPoint(viewMatrix, rtcCenter, rtcCenterEye);

// Compute the RTC model-view matrix by replacing the translation with the center with eye coordinates
var modelViewMatrix = new Matrix4(/* ... */);
var modelViewRTC = Matrix4.clone(modelViewMatrix);
modelViewRTC[12] = rtcCenterEye.x;  // Column-major 4x4 matrix layout
modelViewRTC[13] = rtcCenterEye.y;
modelViewRTC[14] = rtcCenterEye.z;

Listing 2: Example glTF JSON.

"extensions": {
    "CESIUM_RTC": {
        "center": [6378137.0, 0.0, 0.0]
    }
}

Listing 3: Example parameter with the CESIUM_RTC_MODELVIEW semantic.

"techniques": {
    "technique0": {
        "parameters": {
            "modelViewMatrix": {
                "semantic": "CESIUM_RTC_MODELVIEW",
                "type": 35676
             },
             // ...
         }
     }
 }

JSON Schema

See CESIUM_RTC.schema.json.

Known Implementations

Resources