ThreePipe
    Preparing search index...

    Interface ThreeViewerOptions

    Options for the ThreeViewer creation.

    interface ThreeViewerOptions {
        assetManager?: AssetManagerOptions;
        cacheImportedAssets?: boolean;
        camera?:
            | ICamera<ICameraEventMap>
            | {
                controlsMode?: string;
                position?: Vector3 | Vector3Tuple;
                target?: Vector3 | Vector3Tuple;
                type?: "perspective" | "orthographic";
            };
        canvas?: HTMLCanvasElement;
        container?: HTMLElement;
        debug?: boolean;
        dropzone?: boolean
        | DropzonePluginOptions;
        isAntialiased?: boolean;
        load?: {
            background?: null | string | ITexture<TextureEventMap> | IAsset;
            environment?: null | string | ITexture<TextureEventMap> | IAsset;
            src?: ValOrArr<null | string | IAsset>;
        };
        maxHDRIntensity?: number;
        maxRenderScale?: number;
        modelRootScale?: number;
        msaa?: boolean;
        onLoad?: (results: any) => void;
        plugins?: (
            IViewerPluginSync<ThreeViewer>
            | Class<IViewerPluginSync<ThreeViewer>>
        )[];
        powerPreference?: WebGLPowerPreference;
        renderScale?: number | "auto";
        rgbm?: boolean;
        rootScene?: RootScene<ISceneEventMap>;
        screenShader?: TViewerScreenShader;
        stencil?: boolean;
        stopPointerEventPropagation?: boolean;
        tonemap?: boolean;
        useGBufferDepth?: boolean;
        useRgbm?: boolean;
        zPrepass?: boolean;
    }
    Index

    Properties

    assetManager?: AssetManagerOptions

    Options for the asset manager.

    cacheImportedAssets?: boolean

    By default, all imported assets are cached in memory, so that calling import/load would return the same instance of an asset if the same source and options is passed again. Set this to false to disable this caching.

    true
    
    camera?:
        | ICamera<ICameraEventMap>
        | {
            controlsMode?: string;
            position?: Vector3 | Vector3Tuple;
            target?: Vector3 | Vector3Tuple;
            type?: "perspective" | "orthographic";
        }
    canvas?: HTMLCanvasElement

    The canvas element to use for rendering. Only one of container and canvas must be specified.

    container?: HTMLElement

    The container for the canvas. A new canvas will be created in this container. Only one of container and canvas must be specified.

    debug?: boolean
    dropzone?: boolean | DropzonePluginOptions

    Add the dropzone plugin to the viewer, allowing to drag and drop files into the viewer over the canvas/container. Set to true/false to enable/disable the plugin, or pass options to configure the plugin. Assuming true if options are passed.

    - false
    
    isAntialiased?: boolean

    use msaa instead

    load?: {
        background?: null | string | ITexture<TextureEventMap> | IAsset;
        environment?: null | string | ITexture<TextureEventMap> | IAsset;
        src?: ValOrArr<null | string | IAsset>;
    }

    Type declaration

    maxHDRIntensity?: number

    Max HDR intensity for rendering and post-processing. Values above this might be clamped during post-processing.

    72 (when rgbm is false), 16 (when rgbm is true)
    
    maxRenderScale?: number

    Max render scale when set to 'auto'

    2
    
    modelRootScale?: number

    Model Root Scale

    1
    
    msaa?: boolean

    Use MSAA. Renders objects in a multi-sampled buffer.

    false
    
    onLoad?: (results: any) => void

    Add initial plugins.

    powerPreference?: WebGLPowerPreference

    Power preference for the WebGL context.

    'high-performance'
    
    renderScale?: number | "auto"

    Render scale, 1 = full resolution, 0.5 = half resolution, 2 = double resolution. Same as pixelRatio in three.js Can be set to window.devicePixelRatio to render at device resolution in browsers. An optimal value is Math.min(2, window.devicePixelRatio) to prevent issues on mobile. This is set when 'auto' is passed.

    1
    
    rgbm?: boolean

    Use Uint8 RGBM HDR Render Pipeline. Provides better performance with post-processing. RenderManager Uses Half-float if set to false.

    true
    
    screenShader?: TViewerScreenShader

    The fragment shader snippet to render on screen.

    stencil?: boolean

    Enable stencil in renderer and stencilBuffer in composer render targets.

    false
    
    stopPointerEventPropagation?: boolean

    If true, will stop event propagation on all pointer events on the viewer container (when camera interactions are enabled).

    Set this to true when the viewer is inside a carousel or similar component that might interfere with pointer events.

    false
    
    tonemap?: boolean

    TonemapPlugin is added to the viewer if this is true.

    true
    
    useGBufferDepth?: boolean

    use zPrepass instead

    useRgbm?: boolean

    use rgbm instead

    zPrepass?: boolean

    Use rendered gbuffer as depth-prepass / z-prepass. (Requires DepthBufferPlugin/GBufferPlugin). Set it to true if you only have opaque objects in the scene to get better performance.

    false

    todo fix: It should be disabled when there are any transparent/transmissive objects with render to depth buffer enabled, see forceZPrepass