View scales read from the projection matrix three sets for the camera
being drawn with (vertex shaders only: projectionMatrix is a vertex
built-in). Deriving them here, instead of pushing CPU copies computed
from camera.fov, keeps them right for every camera the scene is drawn
with — a cube-capture face (fov −90, a flipped P), a zoomed or asymmetric
frustum, an embedder's camera — and makes a stale copy impossible.
CPU mirror and tests: projection-math.ts.
luxarIsOrthoProjection(): 1 for an orthographic P (last row
(0,0,0,1)), 0 for perspective.
luxarProjectionSizeScale(): |P11|, pixels per view unit at unit
depth per half viewport height. Every size scale is a multiple of
uResolution.y * luxarProjectionSizeScale(). The absolute value keeps
sizes positive under a flipped P; positions keep the sign.
View scales read from the projection matrix three sets for the camera being drawn with (vertex shaders only:
projectionMatrixis a vertex built-in). Deriving them here, instead of pushing CPU copies computed fromcamera.fov, keeps them right for every camera the scene is drawn with — a cube-capture face (fov −90, a flipped P), a zoomed or asymmetric frustum, an embedder's camera — and makes a stale copy impossible. CPU mirror and tests:projection-math.ts.luxarIsOrthoProjection(): 1 for an orthographic P (last row (0,0,0,1)), 0 for perspective.luxarProjectionSizeScale(): |P11|, pixels per view unit at unit depth per half viewport height. Every size scale is a multiple ofuResolution.y * luxarProjectionSizeScale(). The absolute value keeps sizes positive under a flipped P; positions keep the sign.