Skip to content

Commit

Permalink
feat: add meshopt & doc update & fix ownerDocument
Browse files Browse the repository at this point in the history
  • Loading branch information
deepkolos committed Jan 25, 2021
1 parent 936eac9 commit a6368e5
Show file tree
Hide file tree
Showing 4 changed files with 131 additions and 4 deletions.
9 changes: 6 additions & 3 deletions README.md
Expand Up @@ -13,10 +13,10 @@
import { PLATFORM } from 'three-platformize';
import WechatPlatform from 'three-platformize/src/WechatPlatform';

const platform = new WechatPlatform(canvas);
const platform = new WechatPlatform(canvas); // webgl canvas

platform.enableDeviceOrientation('game'); // 开启DeviceOrientation
PLATFORM.set(platform); // webgl canvas
PLATFORM.set(platform);

// 使用完毕后释放资源
PLATFORM.dispose();
Expand All @@ -33,11 +33,13 @@ PLATFORM.dispose();

[淘宝小程序 DEMO](https://github.com/deepkolos/three-platformize-demo-taobao)

> 注:运行DEMO时记得开启调试模式,取消域名验证
## 已测试模块

#### Loader

0. GLTFLoader
0. GLTFLoader (支持带纹理的GLB) && (EXT_meshopt_compression 安卓)
1. TextureLoader
2. RGBELoader & PMREMGenerator
3. SVGLoader
Expand Down Expand Up @@ -90,6 +92,7 @@ PLATFORM.dispose();

## TODO

0. 更彻底dispose,减少内存泄漏
1. 适配头条小程序

### [CHANGELOG](https://github.com/deepkolos/three-platformize/blob/master/CHANGELOG.md)
11 changes: 11 additions & 0 deletions extensions/meshopt_decoder.module.d.ts
@@ -0,0 +1,11 @@
// This file is part of meshoptimizer library and is distributed under the terms of MIT License.
// Copyright (C) 2016-2020, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)
export const MeshoptDecoder: {
supported: boolean;
ready: Promise<void>;

decodeVertexBuffer: (target: Uint8Array, count: number, size: number, source: Uint8Array, filter?: string) => void;
decodeIndexBuffer: (target: Uint8Array, count: number, size: number, source: Uint8Array) => void;
decodeIndexSequence: (target: Uint8Array, count: number, size: number, source: Uint8Array) => void;
decodeGltfBuffer: (target: Uint8Array, count: number, size: number, source: Uint8Array, mode: string, filter?: string) => void;
};

0 comments on commit a6368e5

Please sign in to comment.