Luxar Viewer API Documentation - v2026.10.22
    Preparing search index...

    Module rendering/blend-warmup

    Blend-variant program / pipeline warm-up, for both renderers.

    Headless Chromium often runs WebGL through SwiftShader, whose shader/program link step is synchronous and can monopolize the main thread for seconds. Luxar's Layers panel lets users switch blending modes at runtime, and some mode transitions flip shader defines (max, volumetric, gsplat normal, mesh opaque cutout). Without a warm-up pass, the first click onto each variant pays that synchronous link cost on the interaction path.

    WebGPU pays the same kind of cost per render PIPELINE, and there the blend state is part of the pipeline: every mode is its own variant (the TSL wrappers also rebuild their node graph across the peak/sum boundary). So a WebGPU manager (pipelineVariants) keys variants by mode and compiles with three's compileAsync, which builds the same cached pipelines a later render uses.

    This manager pre-compiles every DISTINCT blend-variant program a live visual material can reach, then draws one tiny primitive for non-transmissive WebGL variants with an ordinary render target so first-use draw state is primed too. Canvas and XR variants are link-warmed only. One variant runs per post-frame idle opportunity so visible rendering and input get a turn before every link. Browsers without idle callbacks use a conservative 50 ms delay. The warmed programs stay pinned by keeper materials until the source material is replaced or disposed.

    BlendWarmupManager
    WarmupConfig
    WarmupTask
    TrackedObjectState
    SourceWarmupState
    BlendWarmupStats
    WarmCompletion
    CompileOptions
    WarmupRenderer
    WaitForWarmupTurn
    DeferActivation
    CompileOne
    buildBlendWarmupFingerprint
    registerBlendWarmupManager
    unregisterBlendWarmupManager
    configureBlendModeProgramWarmup
    scheduleBlendModeProgramWarmupForObject
    warmSceneBlendModePrograms
    clearBlendModeProgramWarmup
    getBlendModeProgramWarmupStats