Returns a snapshot of the object as a png data url, with a transparent background.
Does a simple render, does not run the full pipeline.
With options.size, the object is rendered into a small offscreen target with the given tone mapping and output colour space,
and only that target is read back (see snapObjectPixels). The canvas is not changed. This is much faster than the canvas path on large canvases,
and with the viewer's tone mapping (materialPreviewOptionsFromViewer) the colours match the viewport.
Without size (and with the positional arguments), the object is rendered to the canvas and the whole canvas is read (toDataURL),
without tone mapping and in the renderer's output colour space. Call it from preFrame and then viewer.setDirty(), so that the next frame draws over it.
Returns a snapshot of the object as a png data url, with a transparent background. Does a simple render, does not run the full pipeline.
With
options.size, the object is rendered into a small offscreen target with the given tone mapping and output colour space, and only that target is read back (see snapObjectPixels). The canvas is not changed. This is much faster than the canvas path on large canvases, and with the viewer's tone mapping (materialPreviewOptionsFromViewer) the colours match the viewport.Without
size(and with the positional arguments), the object is rendered to the canvas and the whole canvas is read (toDataURL), without tone mapping and in the renderer's output colour space. Call it frompreFrameand thenviewer.setDirty(), so that the next frame draws over it.Object must be in root, for usage see MaterialPreviewGenerator.