@predy-js/render-interface 0.1.61-beta.1 → 0.1.61-beta.10
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.
- package/dist/index.js +3 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -2
- package/dist/index.mjs.map +1 -1
- package/dist/src/render/MarsMaterialDataBlock.d.ts +4 -1
- package/dist/statistic.js +1 -1
- package/dist/types/Material.d.ts +6 -0
- package/dist/types/ShaderLibrary.d.ts +4 -4
- package/dist/types/native/TextureInternal.d.ts +1 -0
- package/package.json +1 -1
- package/types/Material.ts +3 -0
- package/types/ShaderLibrary.ts +4 -4
- package/types/native/TextureInternal.ts +1 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { MaterialDataBlock, MaterialDataBlockDestroyOptions, MaterialDataBlockOptions, UniformValue, vec2 } from '../../types';
|
1
|
+
import type { MaterialDataBlock, MaterialDataBlockDestroyOptions, MaterialDataBlockOptions, UniformSemantic, UniformValue, vec2 } from '../../types';
|
2
2
|
import type { MarsRenderer } from './MarsRenderer';
|
3
3
|
import type { UniformBlockSpec } from '../webgl/GLUniformUtils';
|
4
4
|
import { UniformBlockBuffer } from '../webgl/GLUniformUtils';
|
@@ -7,6 +7,9 @@ export declare class MarsMaterialDataBlock implements MaterialDataBlock {
|
|
7
7
|
readonly _uniformFlags: Record<string, boolean>;
|
8
8
|
readonly _uniformValueRanges: Record<string, vec2>;
|
9
9
|
readonly name: string;
|
10
|
+
readonly uniformSemantics?: {
|
11
|
+
[key: string]: UniformSemantic;
|
12
|
+
};
|
10
13
|
readonly renderer?: MarsRenderer;
|
11
14
|
readonly uboBufferMap: Record<string, UniformBlockBuffer>;
|
12
15
|
protected _isDestroyed: boolean;
|
package/dist/statistic.js
CHANGED
package/dist/types/Material.d.ts
CHANGED
@@ -115,6 +115,9 @@ export interface MaterialDataBlockOptions {
|
|
115
115
|
[key: string]: UniformValue;
|
116
116
|
};
|
117
117
|
name?: string;
|
118
|
+
uniformSemantics?: {
|
119
|
+
[key: string]: UniformSemantic;
|
120
|
+
};
|
118
121
|
}
|
119
122
|
export interface MaterialDataBlockDestroyOptions {
|
120
123
|
textures?: DestroyOptions;
|
@@ -123,6 +126,9 @@ export declare class MaterialDataBlock implements IGPUResource {
|
|
123
126
|
readonly renderer?: IGPURenderer;
|
124
127
|
readonly isDestroyed: boolean;
|
125
128
|
readonly name: string;
|
129
|
+
readonly uniformSemantics?: {
|
130
|
+
[key: string]: UniformSemantic;
|
131
|
+
};
|
126
132
|
constructor(options: MaterialDataBlockOptions);
|
127
133
|
hasUniformValue(name: string): boolean;
|
128
134
|
setUniformValue(name: string, value: UniformValue): boolean;
|
@@ -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;
|
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
|
-
|
55
|
-
|
56
|
-
|
54
|
+
* 添加shader
|
55
|
+
* @param shader
|
56
|
+
*/
|
57
57
|
addShader(shader: Shader): string;
|
58
58
|
/**
|
59
59
|
* @param cacheId
|
@@ -4,6 +4,7 @@ import type { TypedArray } from '../type';
|
|
4
4
|
import type { ImageBitmapInternal } from './ImageBitmapInternal';
|
5
5
|
export interface TextureInternalOptions extends TextureFormatOptions, Omit<TextureConfigOptionsBase, 'keepImageSource'> {
|
6
6
|
target: WebGLRenderingContext['TEXTURE_CUBE_MAP'] | WebGLRenderingContext['TEXTURE_2D'];
|
7
|
+
generateMipmap?: boolean;
|
7
8
|
}
|
8
9
|
export interface TextureInternalConstructOptions extends TextureInternalOptions {
|
9
10
|
width: number;
|
package/package.json
CHANGED
package/types/Material.ts
CHANGED
@@ -145,6 +145,7 @@ export declare class Material implements IGPUResource {
|
|
145
145
|
export interface MaterialDataBlockOptions {
|
146
146
|
uniformValues?: { [key: string]: UniformValue },
|
147
147
|
name?: string,
|
148
|
+
uniformSemantics?: { [key: string]: UniformSemantic },
|
148
149
|
}
|
149
150
|
|
150
151
|
export interface MaterialDataBlockDestroyOptions {
|
@@ -159,6 +160,8 @@ export declare class MaterialDataBlock implements IGPUResource {
|
|
159
160
|
|
160
161
|
readonly name: string;
|
161
162
|
|
163
|
+
readonly uniformSemantics?: { [key: string]: UniformSemantic };
|
164
|
+
|
162
165
|
constructor (options: MaterialDataBlockOptions);
|
163
166
|
|
164
167
|
hasUniformValue (name: string): boolean;
|
package/types/ShaderLibrary.ts
CHANGED
@@ -2,7 +2,7 @@ export type Shader = ShaderWithSource | ShaderUseCacheId;
|
|
2
2
|
export type ShaderWithSource = InstancedShaderWithSource | SharedShaderWithSource;
|
3
3
|
|
4
4
|
export interface MetaShaderSpec {
|
5
|
-
mtlBinary?: ArrayBuffer
|
5
|
+
mtlBinary?: ArrayBuffer,
|
6
6
|
mtlSource?: string,
|
7
7
|
|
8
8
|
mtlVertex?: string,
|
@@ -72,9 +72,9 @@ export interface ShaderLibrary {
|
|
72
72
|
getShaderResult(cacheId: string): ShaderCompileResult | undefined,
|
73
73
|
|
74
74
|
/**
|
75
|
-
|
76
|
-
|
77
|
-
|
75
|
+
* 添加shader
|
76
|
+
* @param shader
|
77
|
+
*/
|
78
78
|
addShader(shader: Shader): string,
|
79
79
|
|
80
80
|
/**
|
@@ -5,6 +5,7 @@ import type { ImageBitmapInternal } from './ImageBitmapInternal';
|
|
5
5
|
|
6
6
|
export interface TextureInternalOptions extends TextureFormatOptions, Omit<TextureConfigOptionsBase, 'keepImageSource'> {
|
7
7
|
target: WebGLRenderingContext['TEXTURE_CUBE_MAP'] | WebGLRenderingContext['TEXTURE_2D'],
|
8
|
+
generateMipmap?: boolean,
|
8
9
|
}
|
9
10
|
|
10
11
|
export interface TextureInternalConstructOptions extends TextureInternalOptions {
|