@rings-webgpu/core 1.0.25 → 1.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -44,6 +44,8 @@ export declare class Res {
44
44
  loadB3DM(url: string, loaderFunctions?: LoaderFunctions, userData?: any): Promise<Object3D>;
45
45
  loadI3DM(url: string, loaderFunctions?: LoaderFunctions, userData?: any): Promise<Object3D>;
46
46
  loadTexture(url: string, loaderFunctions?: LoaderFunctions, flipY?: boolean): Promise<Texture>;
47
+ destroyTexture(url: string): boolean;
48
+ destroyTextureAllUnUsed(): void;
47
49
  private loadTextureCount;
48
50
  loadBitmapTextures(urls: string[], count?: number, loaderFunctions?: LoaderFunctions, flipY?: boolean): Promise<BitmapTexture2D[]>;
49
51
  loadHDRTexture(url: string, loaderFunctions?: LoaderFunctions): Promise<Texture>;
@@ -41,6 +41,7 @@ export declare class GeometryBase {
41
41
  private _vertexBuffer;
42
42
  private _onChange;
43
43
  private _wireframeLines;
44
+ private _isDestroyed;
44
45
  constructor();
45
46
  get indicesBuffer(): GeometryIndicesBuffer;
46
47
  get vertexBuffer(): GeometryVertexBuffer;
@@ -2,6 +2,8 @@ export declare class Texture implements GPUSamplerDescriptor {
2
2
  name: string;
3
3
  url: string;
4
4
  protected gpuTexture: GPUTexture;
5
+ private _isDestroyed;
6
+ get isDestroyed(): boolean;
5
7
  pid: number;
6
8
  view: GPUTextureView | GPUExternalTexture;
7
9
  gpuSampler: GPUSampler;
@@ -47,7 +47,7 @@ export declare class Shader {
47
47
  setStructStorageBuffer<T extends Struct>(arg0: string, arg1: StructStorageGPUBuffer<T>): void;
48
48
  getStructStorageBuffer(arg0: string): GPUBufferBase;
49
49
  noticeValueChange(): void;
50
- destroy(): void;
50
+ destroy(force?: boolean): void;
51
51
  clone(): Shader;
52
52
  applyUniform(): void;
53
53
  }
@@ -427,6 +427,7 @@ export * from "./loader/parser/kmz/dataDef/point";
427
427
  export * from "./loader/parser/kmz/dataDef/template";
428
428
  export * from "./loader/parser/kmz/dataDef/wayline";
429
429
  export * from "./loader/parser/ply/PlyLoader";
430
+ export * from "./loader/parser/ply/PlyParser";
430
431
  export * from "./loader/parser/ply/PlyTypes";
431
432
  export * from "./loader/parser/ply/PlyUtils";
432
433
  export * from "./loader/parser/prefab/PrefabAvatarParser";
@@ -6,6 +6,7 @@ export declare class FeatureTable {
6
6
  constructor(buffer: any, start: any, headerLength: any, binLength: any);
7
7
  getKeys(): string[];
8
8
  getData(key: any, count?: any, defaultComponentType?: any, defaultType?: any): any;
9
+ destroy(): void;
9
10
  }
10
11
  export declare class BatchTable extends FeatureTable {
11
12
  private batchSize;
@@ -1,9 +1,13 @@
1
- import { PlyHeader, PlyGaussianSplatData } from './PlyTypes';
1
+ import { PlyHeader, PlyGaussianSplatData, PlyMeshData } from './PlyTypes';
2
2
  /**
3
3
  * Parse PLY header from buffer
4
4
  */
5
5
  export declare function parsePlyHeader(buffer: ArrayBuffer): PlyHeader;
6
6
  /**
7
- * Parse PLY binary data for Gaussian Splatting
7
+ * Parse PLY data for Gaussian Splatting (supports both binary and ASCII)
8
8
  */
9
9
  export declare function parsePlyGaussianSplat(buffer: ArrayBuffer): PlyGaussianSplatData;
10
+ /**
11
+ * Parse PLY data for Mesh
12
+ */
13
+ export declare function parsePlyMesh(buffer: ArrayBuffer): PlyMeshData;
@@ -0,0 +1,7 @@
1
+ import { ParserBase } from "../ParserBase";
2
+ import { ParserFormat } from "../ParserFormat";
3
+ export declare class PlyParser extends ParserBase {
4
+ static format: ParserFormat;
5
+ parseBuffer(buffer: ArrayBuffer): Promise<void>;
6
+ verification(): boolean;
7
+ }
@@ -5,14 +5,25 @@ export type PlyProperty = {
5
5
  name: string;
6
6
  type: string;
7
7
  };
8
+ export declare const enum PlyMode {
9
+ Splat = 0,
10
+ PointCloud = 1,
11
+ Mesh = 2
12
+ }
13
+ export declare const splatProperties: string[];
14
+ export declare const splatColorProperties: string[];
8
15
  /**
9
16
  * PLY header information
10
17
  */
11
18
  export type PlyHeader = {
12
19
  format: string;
13
20
  vertexCount: number;
21
+ faceCount: number;
14
22
  properties: PlyProperty[];
23
+ faceProperties?: PlyProperty[];
24
+ textureFiles: string[];
15
25
  headerByteLength: number;
26
+ mode: PlyMode;
16
27
  };
17
28
  /**
18
29
  * Parsed PLY data for Gaussian Splatting
@@ -28,3 +39,17 @@ export type PlyGaussianSplatData = {
28
39
  coeffs: Float32Array;
29
40
  };
30
41
  };
42
+ /**
43
+ * Parsed PLY data for Mesh
44
+ */
45
+ export type PlyMeshData = {
46
+ vertexCount: number;
47
+ faceCount: number;
48
+ position: Float32Array;
49
+ normal: Float32Array;
50
+ color?: Float32Array;
51
+ uv?: Float32Array;
52
+ indices: Uint32Array;
53
+ textureFiles?: string[];
54
+ triangleTexnumbers?: number[];
55
+ };
@@ -290,7 +290,7 @@ export declare class TilesRenderer {
290
290
  /**
291
291
  * Clean up resources
292
292
  */
293
- dispose(): void;
293
+ dispose(force?: boolean): void;
294
294
  /**
295
295
  * Rings-specific: Add camera
296
296
  */
@@ -15,6 +15,7 @@ export declare class Material {
15
15
  enable: boolean;
16
16
  private _defaultSubShader;
17
17
  protected _shader: Shader;
18
+ private _isDestroyed;
18
19
  constructor();
19
20
  set shader(shader: Shader);
20
21
  get shader(): Shader;
@@ -9,4 +9,5 @@ export declare class BitmapTexture2D extends Texture {
9
9
  load(url: string, loaderFunctions?: LoaderFunctions): Promise<unknown>;
10
10
  private imageData;
11
11
  loadFromBlob(imgData: Blob): Promise<boolean>;
12
+ destroy(force?: boolean): void;
12
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rings-webgpu/core",
3
- "version": "1.0.25",
3
+ "version": "1.0.27",
4
4
  "description": "Rings webgpu Engine",
5
5
  "main": "index.js",
6
6
  "exports": {