From 5e89411f87d8e00f29b225a919e88224041d1681 Mon Sep 17 00:00:00 2001 From: Haowei Wen Date: Wed, 9 Sep 2020 13:50:09 +0800 Subject: [PATCH] add docs --- src/fxaa.ts | 4 ++++ src/viewer.ts | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/fxaa.ts b/src/fxaa.ts index 86ae9eb..8717c5c 100644 --- a/src/fxaa.ts +++ b/src/fxaa.ts @@ -10,6 +10,10 @@ export class FXAASkinViewer extends SkinViewer { readonly renderPass: RenderPass; readonly fxaaPass: ShaderPass; + /** + * Note: FXAA doesn't work well with transparent backgrounds. + * It's recommended to use an opaque background and set `options.alpha` to false. + */ constructor(options: SkinViewerOptions = {}) { super(options); this.composer = new EffectComposer(this.renderer); diff --git a/src/viewer.ts b/src/viewer.ts index ce26bac..8e07a63 100644 --- a/src/viewer.ts +++ b/src/viewer.ts @@ -5,7 +5,7 @@ import { PlayerObject } from "./model.js"; export type LoadOptions = { /** - * Whether to make the object visible after the texture is loaded. (default: true) + * Whether to make the object visible after the texture is loaded. Default is true. */ makeVisible?: boolean; } @@ -15,7 +15,17 @@ export type SkinViewerOptions = { height?: number; skin?: RemoteImage | TextureSource; cape?: RemoteImage | TextureSource; + + /** + * Whether the canvas contains an alpha buffer. Default is true. + * This option can be turned off if you use an opaque background. + */ alpha?: boolean; + + /** + * Render target. + * A new canvas is created if this parameter is unspecified. + */ canvas?: HTMLCanvasElement; }