ThreePipe
    Preparing search index...

    Interface MaterialPreviewOptions

    interface MaterialPreviewOptions {
        cameraDirection?: Vector3;
        cameraDistance?: number;
        environment?: ITexture<TextureEventMap> | null;
        environmentIntensity?: number;
        environmentRotation?: Euler;
        geometry?: BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>;
        light?: boolean;
        outputColorSpace?: ColorSpace;
        samples?: number;
        shape?: string;
        size?: number;
        toneMapping?: SnapObjectToneMapping | null;
    }
    Index
    cameraDirection?: Vector3

    Direction from the object to the camera (it is normalized), to turn the preview: a drag on the preview can set it. Default MaterialPreviewGenerator.meshCameraDirection for the mesh shape, (0, 0, 1) for the others.

    cameraDistance?: number

    Distance of the camera as a factor of the default framing: 1 (default) frames the shape, less is closer.

    environment?: ITexture<TextureEventMap> | null

    Environment map. Use the viewer's to match the viewport, see materialPreviewOptionsFromViewer.

    environmentIntensity?: number

    Same as scene.environmentIntensity. Default 1

    environmentRotation?: Euler

    Same as scene.environmentRotation. Default no rotation

    Geometry for the mesh shape (like the geometry of the selected mesh). It is not changed.

    light?: boolean

    Add the hemisphere light of the preview scene. Default: only when there is no environment map, or the material is not lit by the scene environment (only MeshStandardMaterial and MeshPhysicalMaterial are, not Phong, Lambert or Basic), so that a material lit by the environment map looks the same as in the viewport, and the other materials are not black.

    outputColorSpace?: ColorSpace

    Output colour space, SRGBColorSpace (default) or linear.

    samples?: number

    MSAA samples. Default 4

    shape?: string

    Default sphere. mesh renders geometry alone, framed with a camera fitted to its bounds.

    size?: number

    Size of the preview in pixels. Default 256

    toneMapping?: SnapObjectToneMapping | null

    Tone mapping, see SnapObjectToneMapping. Default none