@galacean/effects-webgl 2.0.0-alpha.0 → 2.0.0-alpha.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/gl-material.d.ts +16 -14
- package/dist/gl-shader-library.d.ts +5 -5
- package/dist/gl-shader.d.ts +2 -2
- package/package.json +3 -3
package/dist/gl-material.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { MaterialDestroyOptions, MaterialProps, MaterialStates,
|
|
2
|
-
import { Material, math } from '@galacean/effects-core';
|
|
3
|
-
import { GLMaterialState } from './gl-material-state';
|
|
1
|
+
import type { Engine, GlobalUniforms, MaterialDestroyOptions, MaterialProps, MaterialStates, Renderer, Texture, UndefinedAble } from '@galacean/effects-core';
|
|
2
|
+
import { spec, Material, math } from '@galacean/effects-core';
|
|
4
3
|
import type { GLPipelineContext } from './gl-pipeline-context';
|
|
5
|
-
import type {
|
|
4
|
+
import type { GLShaderVariant } from './gl-shader';
|
|
6
5
|
type Color = math.Color;
|
|
7
6
|
type Vector2 = math.Vector2;
|
|
8
7
|
type Vector3 = math.Vector3;
|
|
@@ -12,7 +11,7 @@ type Matrix4 = math.Matrix4;
|
|
|
12
11
|
type Quaternion = math.Quaternion;
|
|
13
12
|
declare const Vector4: typeof math.Vector4, Matrix4: typeof math.Matrix4;
|
|
14
13
|
export declare class GLMaterial extends Material {
|
|
15
|
-
|
|
14
|
+
shaderVariant: GLShaderVariant;
|
|
16
15
|
private floats;
|
|
17
16
|
private ints;
|
|
18
17
|
private vector2s;
|
|
@@ -26,10 +25,13 @@ export declare class GLMaterial extends Material {
|
|
|
26
25
|
private floatArrays;
|
|
27
26
|
private vector4Arrays;
|
|
28
27
|
private matrixArrays;
|
|
29
|
-
samplers
|
|
30
|
-
uniforms
|
|
31
|
-
uniformDirtyFlag
|
|
32
|
-
|
|
28
|
+
private samplers;
|
|
29
|
+
private uniforms;
|
|
30
|
+
private uniformDirtyFlag;
|
|
31
|
+
private macrosDirtyFlag;
|
|
32
|
+
private readonly macros;
|
|
33
|
+
private glMaterialState;
|
|
34
|
+
constructor(engine: Engine, props?: MaterialProps);
|
|
33
35
|
get blending(): UndefinedAble<boolean>;
|
|
34
36
|
set blending(blending: UndefinedAble<boolean>);
|
|
35
37
|
get blendColor(): UndefinedAble<[r: number, g: number, b: number, a: number]>;
|
|
@@ -74,9 +76,9 @@ export declare class GLMaterial extends Material {
|
|
|
74
76
|
set frontFace(value: UndefinedAble<number>);
|
|
75
77
|
get cullFace(): UndefinedAble<number>;
|
|
76
78
|
set cullFace(value: UndefinedAble<number>);
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
enableMacro(keyword: string, value?: boolean | number): void;
|
|
80
|
+
disableMacro(keyword: string): void;
|
|
81
|
+
isMacroEnabled(keyword: string): boolean;
|
|
80
82
|
createMaterialStates(states: MaterialStates): void;
|
|
81
83
|
get isDestroyed(): boolean;
|
|
82
84
|
/**shader和texture的GPU资源初始化。 */
|
|
@@ -111,13 +113,13 @@ export declare class GLMaterial extends Material {
|
|
|
111
113
|
setTexture(name: string, texture: Texture): void;
|
|
112
114
|
hasUniform(name: string): boolean;
|
|
113
115
|
clone(props?: MaterialProps): Material;
|
|
114
|
-
fromData(data: MaterialData): void;
|
|
116
|
+
fromData(data: spec.MaterialData): void;
|
|
115
117
|
/**
|
|
116
118
|
* @since 2.0.0
|
|
117
119
|
* @param sceneData
|
|
118
120
|
* @returns
|
|
119
121
|
*/
|
|
120
|
-
toData(): MaterialData;
|
|
122
|
+
toData(): spec.MaterialData;
|
|
121
123
|
cloneUniforms(sourceMaterial: Material): void;
|
|
122
124
|
private checkUniform;
|
|
123
125
|
dispose(options?: MaterialDestroyOptions): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Disposable, RestoreHandler, ShaderCompileResult, ShaderLibrary, ShaderWithSource } from '@galacean/effects-core';
|
|
2
|
-
import {
|
|
1
|
+
import type { Disposable, RestoreHandler, ShaderCompileResult, ShaderLibrary, ShaderMarcos, ShaderWithSource } from '@galacean/effects-core';
|
|
2
|
+
import { GLShaderVariant } from './gl-shader';
|
|
3
3
|
import type { GLPipelineContext } from './gl-pipeline-context';
|
|
4
4
|
import type { GLEngine } from './gl-engine';
|
|
5
5
|
export declare class GLShaderLibrary implements ShaderLibrary, Disposable, RestoreHandler {
|
|
@@ -14,9 +14,9 @@ export declare class GLShaderLibrary implements ShaderLibrary, Disposable, Resto
|
|
|
14
14
|
private cachedShaders;
|
|
15
15
|
constructor(engine: GLEngine, pipelineContext: GLPipelineContext);
|
|
16
16
|
compileAllShaders(asyncCallback?: (results: ShaderCompileResult[]) => void): void;
|
|
17
|
-
addShader(shaderSource: ShaderWithSource): string;
|
|
18
|
-
createShader(shaderSource: ShaderWithSource):
|
|
19
|
-
compileShader(shader:
|
|
17
|
+
addShader(shaderSource: ShaderWithSource, macros?: ShaderMarcos): string;
|
|
18
|
+
createShader(shaderSource: ShaderWithSource, macros?: ShaderMarcos): GLShaderVariant;
|
|
19
|
+
compileShader(shader: GLShaderVariant, asyncCallback?: (result: ShaderCompileResult) => void): void;
|
|
20
20
|
private computeShaderCacheId;
|
|
21
21
|
private createProgram;
|
|
22
22
|
private createGLShader;
|
package/dist/gl-shader.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ShaderCompileResult, ShaderWithSource, Texture, Engine, math } from '@galacean/effects-core';
|
|
2
|
-
import {
|
|
2
|
+
import { ShaderVariant } from '@galacean/effects-core';
|
|
3
3
|
import type { GLProgram } from './gl-program';
|
|
4
4
|
import type { GLPipelineContext } from './gl-pipeline-context';
|
|
5
5
|
type Color = math.Color;
|
|
@@ -9,7 +9,7 @@ type Vector4 = math.Vector4;
|
|
|
9
9
|
type Matrix3 = math.Matrix3;
|
|
10
10
|
type Matrix4 = math.Matrix4;
|
|
11
11
|
type Quaternion = math.Quaternion;
|
|
12
|
-
export declare class
|
|
12
|
+
export declare class GLShaderVariant extends ShaderVariant {
|
|
13
13
|
pipelineContext: GLPipelineContext;
|
|
14
14
|
program: GLProgram;
|
|
15
15
|
compileResult: ShaderCompileResult;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/effects-webgl",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.10",
|
|
4
4
|
"description": "Galacean Effects runtime webgl for the web",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
"registry": "https://registry.npmjs.org"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@galacean/effects-core": "2.0.0-alpha.
|
|
41
|
+
"@galacean/effects-core": "2.0.0-alpha.10"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"prebuild": "pnpm clean",
|
|
45
45
|
"build": "pnpm build:declaration",
|
|
46
|
-
"build:declaration": "tsc -d --
|
|
46
|
+
"build:declaration": "tsc -d --emitDeclarationOnly",
|
|
47
47
|
"clean": "rimraf dist && rimraf '*+(.tsbuildinfo)'"
|
|
48
48
|
}
|
|
49
49
|
}
|