Function CreateScreenshotForFrameGraphAsync
-
CreateScreenshotForFrameGraphAsync(
frameGraph: FrameGraph,
camera: Camera,
size: number | IScreenshotSize,
mimeType?: string,
samples?: number,
antialiasing?: boolean,
fileName?: string,
quality?: number,
customDumpData?: (
width: number,
height: number,
data: ArrayBufferView,
successCallback?: (data: string | ArrayBuffer) => void,
mimeType?: string,
fileName?: string,
invertY?: boolean,
toArrayBuffer?: boolean,
quality?: number,
) => void,
automaticDownload?: boolean,
numberOfFramesToRender?: number,
): Promise<string | ArrayBuffer | null>Parameters
- frameGraph: FrameGraph
The frame graph to use for rendering
- camera: Camera
The camera to use for rendering
- size: number | IScreenshotSize
This parameter can be set to a single number or to an object with the following (optional) properties: precision, width, height. If a single number is passed, it will be used for both width and height. If an object is passed, the screenshot size will be derived from the parameters. The precision property is a multiplier allowing rendering at a higher or lower resolution
- mimeType: string = "image/png"
The MIME type of the screenshot image (default: image/png). Check your browser for supported MIME types
- samples: number = 1
Texture samples (default: 1)
- antialiasing: boolean = false
Whether antialiasing should be turned on or not (default: false)
OptionalfileName: stringA name for for the downloaded file.
Optionalquality: numberThe quality of the image if lossy mimeType is used (e.g. image/jpeg, image/webp). See HTMLCanvasElement.toBlob()'s
qualityparameter.OptionalcustomDumpData: (
width: number,
height: number,
data: ArrayBufferView,
successCallback?: (data: string | ArrayBuffer) => void,
mimeType?: string,
fileName?: string,
invertY?: boolean,
toArrayBuffer?: boolean,
quality?: number,
) => voidThe function to use to dump the data. If not provided, the default DumpData function will be used.
- automaticDownload: boolean = false
If true, the screenshot will be automatically downloaded as a file instead of being returned as a string: in this case, null is returned.
OptionalnumberOfFramesToRender: numberIf provided, the number of frames to render before taking the screenshot. If not provided, the screenshot will be taken after the next frame, or after 32 frames if the frame graph has at least one history texture.
Returns Promise<string | ArrayBuffer | null>
screenshot as a string of base64-encoded characters. This string can be assigned to the src parameter of an
to display it. If automaticDownload is true, null is returned instead
- frameGraph: FrameGraph
Generates an image screenshot from the specified frame graph and camera Please note: