This commit is contained in:
Haowei Wen 2020-09-09 13:50:09 +08:00
parent 19325b99b5
commit 5e89411f87
No known key found for this signature in database
GPG Key ID: 5BC167F73EA558E4
2 changed files with 15 additions and 1 deletions

View File

@ -10,6 +10,10 @@ export class FXAASkinViewer extends SkinViewer {
readonly renderPass: RenderPass; readonly renderPass: RenderPass;
readonly fxaaPass: ShaderPass; 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 = {}) { constructor(options: SkinViewerOptions = {}) {
super(options); super(options);
this.composer = new EffectComposer(this.renderer); this.composer = new EffectComposer(this.renderer);

View File

@ -5,7 +5,7 @@ import { PlayerObject } from "./model.js";
export type LoadOptions = { 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; makeVisible?: boolean;
} }
@ -15,7 +15,17 @@ export type SkinViewerOptions = {
height?: number; height?: number;
skin?: RemoteImage | TextureSource; skin?: RemoteImage | TextureSource;
cape?: 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; alpha?: boolean;
/**
* Render target.
* A new canvas is created if this parameter is unspecified.
*/
canvas?: HTMLCanvasElement; canvas?: HTMLCanvasElement;
} }