Interface ThreeViewerOptions

Options for the ThreeViewer creation.

interface ThreeViewerOptions {
    assetManager?: AssetManagerOptions;
    camera?: {
        controlsMode?: string;
        position?: Vector3;
        target?: Vector3;
    };
    canvas?: HTMLCanvasElement;
    container?: HTMLElement;
    debug?: boolean;
    dropzone?: boolean | DropzonePluginOptions;
    forceZPrepass?: boolean;
    isAntialiased?: boolean;
    load?: {
        background?: null | string | ITexture | IAsset;
        environment?: null | string | ITexture | IAsset;
        src?: ValOrArr<null | string | IAsset>;
    };
    msaa?: boolean;
    onLoad?: ((results) => void);
    plugins?: (IViewerPluginSync<ThreeViewer> | Class<IViewerPluginSync<ThreeViewer>>)[];
    renderScale?: number | "auto";
    rgbm?: boolean;
    screenShader?: TViewerScreenShader;
    tonemap?: boolean;
    useGBufferDepth?: boolean;
    useRgbm?: boolean;
    zPrepass?: boolean;
}

Properties

assetManager?: AssetManagerOptions

Options for the asset manager.

camera?: {
    controlsMode?: string;
    position?: Vector3;
    target?: Vector3;
}

Type declaration

  • Optional controlsMode?: string
  • Optional position?: Vector3
  • Optional target?: Vector3
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.

Default

- false
forceZPrepass?: boolean

Force z-prepass even if there are transparent/transmissive objects with render to depth buffer enabled.

isAntialiased?: boolean

Deprecated

use msaa instead

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

Type declaration

  • Optional background?: null | string | ITexture | IAsset

    Load background map

  • Optional environment?: null | string | ITexture | IAsset

    Load environment map

  • Optional src?: ValOrArr<null | string | IAsset>

    Load one or more source files

msaa?: boolean

Use MSAA.

onLoad?: ((results) => void)

Type declaration

    • (results): void
    • Parameters

      • results: any

      Returns void

Add initial plugins.

renderScale?: number | "auto"
rgbm?: boolean

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

screenShader?: TViewerScreenShader

The fragment shader snippet to render on screen.

tonemap?: boolean

TonemapPlugin is added to the viewer if this is true.

Default

true
useGBufferDepth?: boolean

Deprecated

use zPrepass instead

useRgbm?: boolean

Deprecated

use rgbm instead

zPrepass?: boolean

Use rendered gbuffer as depth-prepass / z-prepass. (Requires DepthBufferPlugin/GBufferPlugin) todo: It will be disabled when there are any transparent/transmissive objects with render to depth buffer enabled.

Generated using TypeDoc