Screenshot generation options.

Hierarchy

Properties

antiAliasingQuality?: number

defines the antialiasing quality, higher is better. (range: [0, 32], default: 32)

backgroundColor?: Color4

can be used to override the viewer backgroundColor, for transparent backgrounds a premultiplied alpha color has to be used e.g. (0, 0, 0, 0)

height: number

height of the image in pixel

meshesToRender?: AbstractMesh[]

list of meshes which should be rendered, if null all meshes in the scene will be renderd (default: null)

mimeType?: string

MIME-Type of the data uri (default: "image/png")

onAfterRender?: (() => void)

Type declaration

    • (): void
    • callback which will be called after the rendering

      Returns void

onBeforeRender?: (() => void)

Type declaration

    • (): void
    • callback which will be called before the rendering

      Returns void

onDrawBackground?: ((pContext: CanvasRenderingContext2D) => Promise<void>)

Type declaration

    • (pContext: CanvasRenderingContext2D): Promise<void>
    • Allows do draw a background for the generated screenshot. Only called if the current background color is transparent.

      Parameters

      • pContext: CanvasRenderingContext2D

      Returns Promise<void>

onDrawOverlay?: ((pContext: CanvasRenderingContext2D) => Promise<void>)

Type declaration

    • (pContext: CanvasRenderingContext2D): Promise<void>
    • allows do draw an overlay on the generated screenshot

      Parameters

      • pContext: CanvasRenderingContext2D

      Returns Promise<void>

pixelScaleFactor?: number

pixel scale factor is used to scale certain elements like 2D text (default: 1.0)

renderAsync?: boolean

if true the rendering will be performed asynchronously (default: false)

ssaoQuality?: SSAOQuality

can be used to override the viewer ssaoQuality

targetCanvas?: HTMLCanvasElement

Optional target canvas. If defined the screenshot will be rendered into this canvas. Viewer.createScreenshot() will return an empty string in this case.

width: number

width of the image in pixel

Generated using TypeDoc