@predy-js/render-interface 0.1.61-beta.16 → 0.1.61-beta.18

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.
@@ -1,10 +1,10 @@
1
- import type { GPUBuffer, RenderState, UniformValue, SemanticMap, SemanticGetter, Texture } from '../../types';
1
+ import type { GPUBuffer, RenderState, UniformValue, SemanticMap, SemanticGetter } from '../../types';
2
2
  export declare class MarsSemanticMap implements SemanticMap {
3
3
  readonly semantics: Record<string, SemanticGetter>;
4
4
  constructor(semantics?: Record<string, SemanticGetter>);
5
5
  toObject(): Record<string, SemanticGetter>;
6
6
  setSemantic(name: string, value: SemanticGetter | undefined): void;
7
- getSemanticValue(name: string, state: RenderState): UniformValue | GPUBuffer | Texture | Texture[] | null | undefined;
7
+ getSemanticValue(name: string, state: RenderState): UniformValue | GPUBuffer | null | undefined;
8
8
  hasSemanticValue(name: string): boolean;
9
9
  destroy(): void;
10
10
  }
@@ -36,7 +36,7 @@ export declare class GLProgram {
36
36
  constructor(renderer: GLGPURenderer, program: WebGLProgram, shared: boolean, id: string);
37
37
  init(renderer: GLGPURenderer, program: WebGLProgram): void;
38
38
  bind(): void;
39
- getSemanticValue(state: RenderState, semanticName: string): UniformValue | import("../../types").Texture | import("../../types").Texture[] | import("../../types").GPUBuffer | null | undefined;
39
+ getSemanticValue(state: RenderState, semanticName: string): UniformValue | import("../../types").GPUBuffer | null | undefined;
40
40
  setupUniforms(state: RenderState): void;
41
41
  setGLUniformValue(name: string, value: any, info: ProgramUniformInfo, gl: WebGL2RenderingContext | WebGLRenderingContext): void;
42
42
  setupAttributes(geometry: GLGeometry): GLVertexArrayObject;
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.61-beta.16
5
+ * Version: v0.1.61-beta.18
6
6
  */
7
7
 
8
8
  // https://github.com/greggman/webgl-memory/blob/main/src/texture-utils.js
@@ -110,7 +110,7 @@ export declare class SemanticMap {
110
110
  [key: string]: SemanticGetter;
111
111
  });
112
112
  setSemantic(name: string, value: SemanticGetter | undefined): void;
113
- getSemanticValue(name: string, state: RenderState): UniformValue | GPUBuffer | Texture | Texture[] | null | undefined;
113
+ getSemanticValue(name: string, state: RenderState): UniformValue | GPUBuffer | null | undefined;
114
114
  hasSemanticValue(name: string): boolean;
115
115
  toObject(): Record<string, SemanticGetter>;
116
116
  destroy(): void;
@@ -1,5 +1,6 @@
1
1
  import type { ResourceInternal } from './ResourceInternal';
2
2
  import type { TypedArray } from '../type';
3
+ import type { TextureInternal } from './TextureInternal';
3
4
  export interface DataBlockInternalOptions {
4
5
  name: string;
5
6
  }
@@ -26,4 +27,6 @@ export declare abstract class DataBlockInternal implements ResourceInternal {
26
27
  * @param value
27
28
  */
28
29
  abstract getUniformValue(name: string, value: TypedArray): boolean;
30
+ abstract setUniformTexture(uniformName: string, texture: TextureInternal[] | undefined): void;
31
+ abstract getUniformTexture(uniformName: string): TextureInternal[] | undefined;
29
32
  }
@@ -1,7 +1,6 @@
1
1
  import type { ResourceInternal } from './ResourceInternal';
2
2
  import type { MaterialRenderStates } from '../Material';
3
3
  import type { DataBlockInternal } from './DataBlockInternal';
4
- import type { TextureInternal } from './TextureInternal';
5
4
  export interface MaterialInternalOptions {
6
5
  states: MaterialRenderStates;
7
6
  dataBlocks: DataBlockInternal[];
@@ -15,12 +14,4 @@ export declare abstract class MaterialInternal implements ResourceInternal {
15
14
  dataBlocks: DataBlockInternal[];
16
15
  protected constructor(options: MaterialInternalOptions);
17
16
  abstract destroy(): void;
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[];
26
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@predy-js/render-interface",
3
- "version": "0.1.61-beta.16",
3
+ "version": "0.1.61-beta.18",
4
4
  "license": "MIT",
5
5
  "module": "./dist/index.mjs",
6
6
  "main": "./dist/index.js",
@@ -149,7 +149,7 @@ export declare class SemanticMap {
149
149
 
150
150
  setSemantic (name: string, value: SemanticGetter | undefined): void;
151
151
 
152
- getSemanticValue (name: string, state: RenderState): UniformValue | GPUBuffer | Texture | Texture[] | null | undefined;
152
+ getSemanticValue (name: string, state: RenderState): UniformValue | GPUBuffer | null | undefined;
153
153
 
154
154
  hasSemanticValue (name: string): boolean;
155
155
 
@@ -1,5 +1,6 @@
1
1
  import type { ResourceInternal } from './ResourceInternal';
2
2
  import type { TypedArray } from '../type';
3
+ import type { TextureInternal } from './TextureInternal';
3
4
 
4
5
  export interface DataBlockInternalOptions {
5
6
  name: string,
@@ -32,4 +33,8 @@ export abstract class DataBlockInternal implements ResourceInternal {
32
33
  */
33
34
  abstract getUniformValue (name: string, value: TypedArray): boolean;
34
35
 
36
+ abstract setUniformTexture (uniformName: string, texture: TextureInternal[] | undefined): void;
37
+
38
+ abstract getUniformTexture (uniformName: string): TextureInternal[] | undefined;
39
+
35
40
  }
@@ -1,7 +1,6 @@
1
1
  import type { ResourceInternal } from './ResourceInternal';
2
2
  import type { MaterialRenderStates } from '../Material';
3
3
  import type { DataBlockInternal } from './DataBlockInternal';
4
- import type { TextureInternal } from './TextureInternal';
5
4
  export interface MaterialInternalOptions {
6
5
  states: MaterialRenderStates,
7
6
  dataBlocks: DataBlockInternal[],
@@ -18,14 +17,4 @@ export abstract class MaterialInternal implements ResourceInternal {
18
17
  protected constructor (options: MaterialInternalOptions) {
19
18
  }
20
19
  abstract destroy (): void;
21
-
22
- /**
23
- * 对于 uniform sampler2D uTex
24
- * 和 uniform sampler2D uTextures[4] 都使用此函数
25
- * @param name
26
- * @param value
27
- */
28
- abstract setUniformTextures (name: string, value: TextureInternal[]): void;
29
-
30
- abstract getUniformTextures (name: string): TextureInternal[];
31
20
  }