RenderOriginState
Defined in: sdk/src/render/renderOrigin.ts:14
renderOrigin.ts
The point a frame is drawn relative to, so a world far from zero keeps its precision on the GPU.
Details
Section titled “Details”Single floats hold a position well only near zero: at 50 km from it a step is 4 mm, and the vertices of a mesh there jitter as the
camera moves. The renderer takes every world position from an origin near the camera before it reaches the GPU, and the camera’s
view-projection is built for the same origin, so the picture is the same and the numbers in it are small. The origin is the
camera’s position rounded to step, and it stays where it is until the camera is further than step from it: shadow maps, the
light grid and other caches that are laid out on the world’s grid step only when it does, not with every frame. Off (step 0) it is
zero, which changes nothing.
Properties
Section titled “Properties”step:
number
Defined in: sdk/src/render/renderOrigin.ts:16
The grid the origin is rounded to, and how far the camera goes from it before it moves; 0 draws relative to the world’s own zero.
x:
number
Defined in: sdk/src/render/renderOrigin.ts:17
y:
number
Defined in: sdk/src/render/renderOrigin.ts:18
z:
number
Defined in: sdk/src/render/renderOrigin.ts:19