add 'preserveDrawingBuffer' option
The default value of 'preserveDrawingBuffer' is changed back to false due to performance concern. To turn it on, you have to specify 'preserveDrawingBuffer: true' in SkinViewerOptions. Related: #65, #67
This commit is contained in:
parent
5e89411f87
commit
0b9cccfa68
|
@ -27,6 +27,11 @@ export type SkinViewerOptions = {
|
|||
* A new canvas is created if this parameter is unspecified.
|
||||
*/
|
||||
canvas?: HTMLCanvasElement;
|
||||
|
||||
/**
|
||||
* Whether to preserve the buffers until manually cleared or overwritten. Default is false.
|
||||
*/
|
||||
preserveDrawingBuffer?: boolean;
|
||||
}
|
||||
|
||||
function toMakeVisible(options?: LoadOptions): boolean {
|
||||
|
@ -75,8 +80,9 @@ class SkinViewer {
|
|||
|
||||
this.renderer = new WebGLRenderer({
|
||||
canvas: this.canvas,
|
||||
alpha: options.alpha !== false, // alpha is on by default
|
||||
preserveDrawingBuffer: true
|
||||
alpha: options.alpha !== false, // default: true
|
||||
preserveDrawingBuffer: options.preserveDrawingBuffer === true // default: false
|
||||
|
||||
});
|
||||
this.renderer.setPixelRatio(window.devicePixelRatio);
|
||||
|
||||
|
|
Loading…
Reference in New Issue