Rendering

Splats

46 symbols, imported from @driftengine/splats.

Explained in Gaussian splats.

Classes

SplatCapture
A capture assembled from blocks, one .drft chunk at a time.
SplatSorter
Hold the newest order, ask for a new one when the view has changed enough, and never queue.

Interfaces

DecodedImage
One decoded image: 8-bit RGBA, row-major from the top left, four bytes a texel.
SogMeta
What a .sog manifest declares. Field names are the file's, not this engine's.
SplatAppend
Where a block landed, so a caller uploads what arrived rather than the whole texture.
SplatCaptureOptions
SplatData
A capture packed for the GPU, plus the two things the CPU still needs.
SplatPass
SplatSorterOptions
SplatSortRequest
One sort, as the worker protocol and as the function's own parameter list.
SplatSortResult
What a sort answers with: the filled buffer, and how many entries of it are real.
SplatSortScratch
The arrays a sort reuses, allocated once by the caller.
SplatSource
A capture as a reader hands it over: linear values, one array per attribute.
SplatView
What a consumer hands the pass each frame.
SplatViewLocal
The camera as the sorter needs it: in the capture's coordinates rather than the world's.

Functions

browserWebpDecoder
The ordinary decoder: @driftengine/core's exact texel read.
createDefaultSplatSort
The shipped capability: a worker over the same sort this module runs on the main thread.
createSplatPass
Build a pass for one capture.
createSplatSortScratch
createSplatViewLocal
defaultSplatBudget
The budget to hand SplatSorter when the consumer has no number of its own.
packSplats
Turn a source into two texels per splat, and compute the capture's bounds while the loop is open.
readSogMeta
Parse and check a meta.json. Refuses a version it does not understand rather than guessing.
readSogSource
The same read, stopping one step short: the linear values, before they are packed for the GPU.
readSplat
Read a .splat capture.
readSplatPly
Read a .ply Gaussian capture.
readSplatSog
Read a .sog capture into a SplatSource.
resolveSplatView
Fill out with the camera, in the space the capture's own positions are written in.
sortOnMainThread
sortSplatsByDepth
Order the splats worth drawing far to near, writing indices into request.out.
splatBoundsVisible
Is any part of the box [boundsMin, boundsMax] inside the frustum?
splatsFromRecords
A whole capture in one go, for a caller that read the file rather than streamed it.
unbundleSog
Unpack a bundled .sog, which is a ZIP with every file at the root.

Types

SogFiles
The files a capture is made of, by the names its manifest gives them.
SplatSortFn
How a sort actually happens.
WebpDecoder
What turns a WebP file's bytes into texels. See this file's header for why it is a parameter.

Constants

SOG_VERSION
The container version this reader understands.
SPLAT_BUDGET_DEFAULT
The count a part this engine has no evidence against is asked to draw.
SPLAT_BUDGET_WEAK
The count a part measured to struggle with the good profile is asked to draw.
SPLAT_RECORD_BYTES
Position, scale, colour and rotation, in that order, little-endian.
SPLAT_SH1_COEFFICIENTS
Three basis functions at l=1, three channels each.
SPLAT_SIZE_BUCKETS
How many buckets the screen-space size key has.
SPLAT_SORT_BUCKETS
How many buckets the depth key has. A sixteen-bit key, so 65,536 of them.
SPLAT_STRIDE
Splats per row.
SPLAT_WORDS
How many uint32s a splat occupies with no view-dependent colour: two RGBA32UI texels.
SPLAT_WORDS_SH1
The same with degree-1 view-dependent colour: one more texel, and no more than one.