Homesplat-transform API Reference - v3.10.0
    Preparing search index...

    Type Alias WriteImageOptions

    Options for writing a rendered splat image.

    type WriteImageOptions = {
        background?: { a: number; b: number; g: number; r: number };
        cameraEndPosition?: Vec3Like;
        cameraPosition?: Vec3Like;
        cameraTrack?: CameraTrack;
        createDevice?: DeviceCreator;
        dofSamples?: number;
        filename: string;
        focusDistance?: number;
        fov?: number;
        frames?: [number, number];
        fStop?: number;
        height?: number;
        lookAt?: Vec3Like;
        lookAtEnd?: Vec3Like;
        motionSamples?: number;
        near?: number;
        pool: ChunkDataPool;
        projection?: Projection;
        residentBudget?: number;
        sensorSize?: number;
        shutter?: number;
        source: ChunkSource;
        up?: Vec3Like;
        upEnd?: Vec3Like;
        webpEffort?: number;
        width?: number;
    }
    Index
    background?: { a: number; b: number; g: number; r: number }

    RGBA background, each channel in [0, 1]. Default: (0, 0, 0, 1).

    cameraEndPosition?: Vec3Like

    End camera position for motion blur. When set, enables camera motion blur: the camera moves from (cameraPosition, lookAt, up) at shutter-open to (cameraEndPosition, lookAtEnd, upEnd) at shutter-close, and the frame averages renders at motionSamples instants across the shutter. Not valid with cameraTrack, whose motion blur comes from shutter.

    cameraPosition?: Vec3Like

    Camera position in world space. Default: (2, 1, -2). Ignored with cameraTrack.

    cameraTrack?: CameraTrack

    Camera animation to render as a frame sequence. Poses come from the track (position, target and fov per frame; up still applies) and the scene stays resident on the GPU across frames.

    createDevice?: DeviceCreator

    Function returning a GraphicsDevice. Required — rasterization runs on GPU.

    dofSamples?: number

    Circular-aperture samples averaged for depth of field. Default: 32. Higher counts reduce sampling artifacts and cost more render passes. With motion blur, each of its instants uses this many samples. Has no effect without fStop; one sample renders the lens center.

    filename: string

    Output filename ending in .webp. With cameraTrack, each frame is written as <stem>.NNNN.webp (zero-padded frame index).

    focusDistance?: number

    Camera-space Z of the focus plane in world units. Defaults to the distance from cameraPosition to lookAt along the forward axis (i.e. focus on the look-at point) when fStop is set. Has no effect without fStop. Pinhole only — passing this with projection: 'equirect' is an error.

    fov?: number

    Vertical field of view in degrees. Default: 60 for pinhole. Must be omitted for equirect (throws if supplied). With cameraTrack, the track's per-pose fov takes precedence.

    frames?: [number, number]

    Inclusive frame range of cameraTrack to render. Default: every frame.

    fStop?: number

    Aperture as a photographic f-stop (e.g. 2.8, 5.6, 11). Enables defocus blur / depth-of-field: smaller numbers = stronger blur. Defaults to disabled. Pinhole only — passing this with projection: 'equirect' is an error.

    height?: number

    Output image height in pixels. Default: 720 (pinhole) or 1024 (equirect).

    lookAt?: Vec3Like

    Point the camera looks at, in world space. Default: (0, 0, 0). Ignored with cameraTrack.

    lookAtEnd?: Vec3Like

    End look-at target for motion blur. Defaults to lookAt when motion blur is enabled.

    motionSamples?: number

    Renders averaged per motion-blurred frame, at evenly spaced instants across the shutter; cost is N× a single render. Each instant is composited exactly, so the mean converges to the true time average as N grows; too few instants show as discrete copies wherever the motion between them exceeds a couple of pixels. Default: 16. Only meaningful when motion blur is enabled.

    near?: number

    Near clip distance in world units. Splats with camera-space depth <= near are culled. Default: 0.2 (matches the reference 3DGS rasterizer).

    Pool for the source's read buffers; its chunk size must be at least the source's.

    projection?: Projection

    Camera projection mode. Default: 'pinhole'.

    • 'pinhole' — perspective camera using fov.
    • 'equirect' — full 360° × 180° equirectangular panorama from cameraPosition. Ignores fov. Requires width === 2 × height; default resolution is 2048 × 1024.
    residentBudget?: number

    Most bytes to hold GPU-resident for the scene. The resident path uploads the scene once and renders every pass from it; scenes over this budget, or over the device's binding limits, or that the device refuses to allocate, stream through the chunked path instead. Default: no budget.

    sensorSize?: number

    Vertical sensor height in world units, used to give fStop a defined physical meaning. Default 0.024 matches a 35mm full-frame sensor when world units are meters. Scale this with your scene's units (e.g. world unit = decimeter → 0.24, world unit = millimeter → 24). Has no effect without fStop.

    shutter?: number

    Shutter fraction in [0, 1]. For a start→end segment, the portion actually integrated, centered on the midpoint (standard shutter-angle convention: 1.0 = full motion, 0.5 = 180° shutter); default 0.5. For a cameraTrack, setting it enables motion blur over that fraction of the frame interval, centered on each frame; default off.

    source: ChunkSource

    The scene to render (its LOD 0). Its pending transform is honoured by moving the camera into the scene's space.

    up?: Vec3Like

    World-space up vector. Default: (0, 1, 0).

    upEnd?: Vec3Like

    End up vector for motion blur. Defaults to up when motion blur is enabled.

    webpEffort?: number

    WebP lossless compression effort, 0–9. Higher levels spend more time trying to reduce file size. Omit to use the default WebP encoder.

    width?: number

    Output image width in pixels. Default: 1280 (pinhole) or 2048 (equirect).