Namespace Apogee.Core.Numerics¶
Classes¶
Axis-aligned boxes as separate arrays of centers and half extents (structure of arrays), so that a vector instruction tests eight (or four) of them against a
plane at once. The arrays are padded to a multiple of
Tests boxes against a k of byte b is box 8b + k.
There are three kernels with the same arithmetic in the same order, so they give the same bits:
Structs¶
A position in the double-precision world: three doubles (24 bytes). Float has 24 bits of precision, so at 5 km from
the origin a float position moves in 0.5 mm steps; a double keeps sub-micrometre steps for thousands of kilometres.
Only positions are double. Directions, rotations, scales and everything the GPU sees stay float: positions are turned into
float offsets from a nearby origin (the camera) with
The view volume of a perspective camera with an infinite far plane, as five planes (left, right, bottom, top, near) in the camera-relative
space the renderer works in. A plane is (nx, ny, nz, d) and a point is inside when n·p + d >= 0 for all five. The four side planes
pass through the camera, which is the origin, so their d is zero; forward * tan + right); the culling kernel takes that into account.
A placement in the double-precision world: a