highpModelViewMatrix
Provides a high-precision model-view matrix for transforming vertices from model space to view space, specifically designed to eliminate rendering jitter in large-scale worlds.
Core Advantages
Automates the calculation and updating of the model-view matrix and fundamentally solves the jittering issue in large-scale worlds via high-precision computation. Developers get stable, accurate vertex transformations without manually managing matrices and uniforms.
Common Uses
In the vertex shader, to transform local vertex coordinates (positionLocal) to view space, which is fundamental for all subsequent rendering calculations.
To provide a unified coordinate system for view-space lighting algorithms, simplifying the calculation of light and view vectors.
To supply accurate depth information for fog calculations via the Z-component of the transformed vertex position.
In special effects like outline rendering, to provide a correct geometric basis for vertex displacement operations in view space.
How to adjust
This node has no adjustable parameters; its effect is determined by the object and camera transformations in the scene. Its core value lies in solving the large-world problem: without it, models will jitter severely when far from the world origin; using it ensures the rendering remains stable and artifact-free.
Code Examples
1
2// Transform local vertex coordinates to view space
3const positionView = highpModelViewMatrix * positionLocal();
4