@predy-js/render-interface 0.1.60-beta.5 → 0.1.60

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.
@@ -4,7 +4,6 @@ export * from '../types/Texture';
4
4
  export * from '../types/GPUBuffer';
5
5
  export { constants } from './webgl/constants';
6
6
  export * from '../types/ShaderLibrary';
7
- export * as types from '../types';
8
7
  export { MarsRenderFrame as RenderFrame } from './render/MarsRenderFrame';
9
8
  export { MarsRenderer as Renderer } from './render/MarsRenderer';
10
9
  export { MarsMesh as Mesh, MarsInstancedMesh as InstancedMesh } from './render/MarsMesh';
package/dist/statistic.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * Name: @predy-js/render-interface
3
3
  * Description: undefined
4
4
  * Author: undefined
5
- * Version: v0.1.60-beta.5
5
+ * Version: v0.1.60
6
6
  */
7
7
 
8
8
  // https://github.com/greggman/webgl-memory/blob/main/src/texture-utils.js
@@ -1,7 +1,7 @@
1
1
  export type Shader = ShaderWithSource | ShaderUseCacheId;
2
2
  export type ShaderWithSource = InstancedShaderWithSource | SharedShaderWithSource;
3
3
  export interface MetaShaderSpec {
4
- mtlBinary?: ArrayBuffer;
4
+ mtlBinary?: ArrayBuffer | string;
5
5
  mtlSource?: string;
6
6
  mtlVertex?: string;
7
7
  mtlFragment?: string;
@@ -51,9 +51,9 @@ export interface ShaderLibrary {
51
51
  readonly cacheIds: string[];
52
52
  getShaderResult(cacheId: string): ShaderCompileResult | undefined;
53
53
  /**
54
- * 添加shader
55
- * @param shader
56
- */
54
+ * 添加shader
55
+ * @param shader
56
+ */
57
57
  addShader(shader: Shader): string;
58
58
  /**
59
59
  * @param cacheId
@@ -13,6 +13,7 @@ export * from './RenderPass';
13
13
  export * from './Mesh';
14
14
  export * from './Geometry';
15
15
  export * from './ShaderLibrary';
16
+ export { GPURenderer as Renderer } from './Renderer';
16
17
  export * from './type';
17
18
  export declare function getDefaultTextureFactory(): TextureFactory;
18
19
  export declare function setDefaultTextureFactory(factory: TextureFactory): void;
@@ -15,6 +15,12 @@ export declare abstract class MaterialInternal implements ResourceInternal {
15
15
  dataBlocks: DataBlockInternal[];
16
16
  protected constructor(options: MaterialInternalOptions);
17
17
  abstract destroy(): void;
18
- abstract setUniformTexture(name: string, value: TextureInternal): void;
19
- abstract getUniformTexture(name: string): TextureInternal;
18
+ /**
19
+ * 对于 uniform sampler2D uTex
20
+ * 和 uniform sampler2D uTextures[4] 都使用此函数
21
+ * @param name
22
+ * @param value
23
+ */
24
+ abstract setUniformTextures(name: string, value: TextureInternal[]): void;
25
+ abstract getUniformTextures(name: string): TextureInternal[];
20
26
  }
@@ -18,8 +18,12 @@ export declare abstract class RenderFrameInternal implements ResourceInternal {
18
18
  abstract destroy(): void;
19
19
  /**
20
20
  * warp层完成所有数据传输后,通知客户端,可以进行实际渲染,
21
- * 实际渲染根据客户端时机进行
21
+ * 实际渲染根据客户端时机进行,在调用end()之前,客户端会根据实际刷新进行绘制
22
22
  */
23
- abstract flush(): void;
23
+ abstract begin(): void;
24
+ /**
25
+ * 将RenderFrame移除渲染队列
26
+ */
27
+ abstract end(): void;
24
28
  abstract updateLoadAction(action: RenderPassLoadAction): void;
25
29
  }
@@ -40,6 +40,8 @@ export declare abstract class RendererInternal implements ResourceInternal {
40
40
  abstract createRenderFrame(options: RenderFrameInternalOptions): RenderFrameInternal;
41
41
  abstract createTexture(options: TextureInternalConstructOptions): TextureInternal;
42
42
  abstract getResourceInfo(): InternalResInfo;
43
+ abstract requestAnimationFrame(callback: (timestamp: number) => void): number;
44
+ abstract cancelAnimationFrame(id: number): void;
43
45
  abstract createImageBitmap(data: ArrayBuffer | string, //图片文件的数据
44
46
  options: ImageBitmapConstructor, callback: ImageBitmapCallback): void;
45
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@predy-js/render-interface",
3
- "version": "0.1.60-beta.5",
3
+ "version": "0.1.60",
4
4
  "license": "MIT",
5
5
  "module": "./dist/index.mjs",
6
6
  "main": "./dist/index.js",