update readme

This commit is contained in:
Haowei Wen 2021-09-23 10:13:59 +08:00
parent 5c2bcacf7c
commit 7114f93c7c
No known key found for this signature in database
GPG Key ID: 5BC167F73EA558E4
1 changed files with 9 additions and 11 deletions

View File

@ -38,12 +38,18 @@ Three.js powered Minecraft skin viewer.
// Load a cape
skinViewer.loadCape("img/cape.png");
// Load a elytra (from a cape texture)
// Load an elytra (from a cape texture)
skinViewer.loadCape("img/cape.png", { backEquipment: "elytra" });
// Unload(hide) the cape / elytra
skinViewer.loadCape(null);
// Set the background color
skinViewer.background = 0x5a76f3;
// Set the background to a panoramic image!
skinViewer.loadPanorama("img/panorama1.png");
// Control objects with your mouse!
let control = skinview3d.createOrbitControls(skinViewer);
control.enableRotate = true;
@ -74,16 +80,8 @@ Three.js powered Minecraft skin viewer.
skinview3d supports FXAA (fast approximate anti-aliasing).
To enable it, you need to replace `SkinViewer` with `FXAASkinViewer`.
You must use an **opaque** background when FXAA is enabled,
because FXAA is incompatible with transparent backgrounds.
By default, when FXAA is enabled, the background color is white.
To use a different color:
```javascript
let skinViewer = new skinview3d.FXAASkinViewer(...);
// Set the background color to blue
skinViewer.background = 0x5a76f3;
```
Note that FXAA is incompatible with transparent backgrounds.
So when FXAA is enabled, the default background color will be white instead of transparent.
# Build
`npm run build`