Hold all configurable parameters for the viewer

interface Config {
    3dCommerceCertified?: boolean;
    basisTranscoder?: {
        urlConfig?: {
            jsModuleUrl?: string;
            wasmModuleUrl?: string;
        };
    };
    cameraConfig?: CameraConfig;
    dracoCompression?: {
        decoders?: {
            fallbackUrl?: string;
            wasmBinaryUrl?: string;
            wasmUrl?: string;
        };
        defaultNumWorkers?: number;
    };
    enableDragAndDrop?: boolean;
    engineConfig?: {
        antialiasing?: boolean;
        disableResize?: boolean;
        engineOptions?: EngineOptions;
        useNullEngine?: boolean;
    };
    extensionConfig?: object;
    ktx2Decoder?: {
        defaultNumWorkers?: number;
        urlConfig?: {
            jsDecoderModule: string;
            jsMSCTranscoder: null | string;
            wasmMSCTranscoder: null | string;
            wasmUASTCToASTC: null | string;
            wasmUASTCToBC7: null | string;
            wasmUASTCToR8_UNORM: null | string;
            wasmUASTCToRG8_UNORM: null | string;
            wasmUASTCToRGBA_SRGB: null | string;
            wasmUASTCToRGBA_UNORM: null | string;
            wasmZSTDDecoder: null | string;
        };
    };
    lightingConfig?: LightingConfig;
    meshoptCompression?: {
        decoder?: {
            url: string;
        };
    };
    renderingPipelineConfig?: RenderingPipelineConfig;
    sceneConfig?: SceneConfig;
}

Properties

3dCommerceCertified?: boolean

Whether to enable 3D Commerce Certified Viewer

basisTranscoder?: {
    urlConfig?: {
        jsModuleUrl?: string;
        wasmModuleUrl?: string;
    };
}

Basis transcoder configuration

Type declaration

  • OptionalurlConfig?: {
        jsModuleUrl?: string;
        wasmModuleUrl?: string;
    }

    Define where to find transcoder files. It can be an external URL or a local file path.

    empty string for all urls
    
    • OptionaljsModuleUrl?: string
    • OptionalwasmModuleUrl?: string
cameraConfig?: CameraConfig

Camera configuration

create an ArcRotateCamera with alpha = 0, beta = 0, radius = 1, and target = Vector3.Zero
dracoCompression?: {
    decoders?: {
        fallbackUrl?: string;
        wasmBinaryUrl?: string;
        wasmUrl?: string;
    };
    defaultNumWorkers?: number;
}

Draco compression configuration

Type declaration

  • Optionaldecoders?: {
        fallbackUrl?: string;
        wasmBinaryUrl?: string;
        wasmUrl?: string;
    }

    Define where to find decoders. It can be an external URL or a local file path.

    empty string for all urls
    
    • OptionalfallbackUrl?: string
    • OptionalwasmBinaryUrl?: string
    • OptionalwasmUrl?: string
  • OptionaldefaultNumWorkers?: number

    Default number of workers to create when creating the draco compression object

    defer to babylon.js
    
enableDragAndDrop?: boolean

Whether to enable drag and drop feature. When enabled, users are able to drag and drop their local model files to the viewer.

false
engineConfig?: {
    antialiasing?: boolean;
    disableResize?: boolean;
    engineOptions?: EngineOptions;
    useNullEngine?: boolean;
}

Engine configuration

Type declaration

  • Optionalantialiasing?: boolean

    Whether to enable antialiasing

    true
    
  • OptionaldisableResize?: boolean

    Whether to disable handling 'resize' event

    false
    
  • OptionalengineOptions?: EngineOptions

    Interface defining initialization parameters for Engine class

  • OptionaluseNullEngine?: boolean

    Whether to use NullEngine which provides support for headless version of babylon.js. This can be used in server side scenario or for testing purposes.

extensionConfig?: object

Extension configuration

ktx2Decoder?: {
    defaultNumWorkers?: number;
    urlConfig?: {
        jsDecoderModule: string;
        jsMSCTranscoder: null | string;
        wasmMSCTranscoder: null | string;
        wasmUASTCToASTC: null | string;
        wasmUASTCToBC7: null | string;
        wasmUASTCToR8_UNORM: null | string;
        wasmUASTCToRG8_UNORM: null | string;
        wasmUASTCToRGBA_SRGB: null | string;
        wasmUASTCToRGBA_UNORM: null | string;
        wasmZSTDDecoder: null | string;
    };
}

Khronos Texture Extension 2 (KTX2) decoder configuration

Type declaration

  • OptionaldefaultNumWorkers?: number

    Default number of workers used to handle data decoding

    defer to babylon.js
    
  • OptionalurlConfig?: {
        jsDecoderModule: string;
        jsMSCTranscoder: null | string;
        wasmMSCTranscoder: null | string;
        wasmUASTCToASTC: null | string;
        wasmUASTCToBC7: null | string;
        wasmUASTCToR8_UNORM: null | string;
        wasmUASTCToRG8_UNORM: null | string;
        wasmUASTCToRGBA_SRGB: null | string;
        wasmUASTCToRGBA_UNORM: null | string;
        wasmZSTDDecoder: null | string;
    }

    Define where to find decoders. It can be an external URL or a local file path.

    empty string or null for all urls
    
    • jsDecoderModule: string
    • jsMSCTranscoder: null | string
    • wasmMSCTranscoder: null | string
    • wasmUASTCToASTC: null | string
    • wasmUASTCToBC7: null | string
    • wasmUASTCToR8_UNORM: null | string
    • wasmUASTCToRG8_UNORM: null | string
    • wasmUASTCToRGBA_SRGB: null | string
    • wasmUASTCToRGBA_UNORM: null | string
    • wasmZSTDDecoder: null | string
lightingConfig?: LightingConfig

Lighting configuration

meshoptCompression?: {
    decoder?: {
        url: string;
    };
}

Meshopt compression configuration

Type declaration

  • Optionaldecoder?: {
        url: string;
    }

    Define where to find decoder file. It can be an external URL or a local file path.

    empty string for all urls
    
    • url: string
renderingPipelineConfig?: RenderingPipelineConfig

Rendering pipeline configuration

sceneConfig?: SceneConfig

Scene configuration