@galacean/effects-webgl 1.0.0 → 1.1.0-alpha.0
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 +29 -18
- package/dist/gl-pipeline-context.d.ts +14 -6
- package/dist/gl-renderer.d.ts +4 -2
- package/dist/gl-shader.d.ts +14 -6
- package/package.json +2 -2
package/dist/gl-material.d.ts
CHANGED
|
@@ -1,18 +1,26 @@
|
|
|
1
|
-
import type { MaterialDestroyOptions, MaterialProps, MaterialStates, UndefinedAble, Texture,
|
|
2
|
-
import { Material } from '@galacean/effects-core';
|
|
1
|
+
import type { MaterialDestroyOptions, MaterialProps, MaterialStates, UndefinedAble, Texture, Engine, GlobalUniforms } from '@galacean/effects-core';
|
|
2
|
+
import { Material, math } from '@galacean/effects-core';
|
|
3
3
|
import { GLMaterialState } from './gl-material-state';
|
|
4
4
|
import type { GLPipelineContext } from './gl-pipeline-context';
|
|
5
5
|
import type { GLShader } from './gl-shader';
|
|
6
6
|
import type { GLRenderer } from './gl-renderer';
|
|
7
|
+
type Vector2 = math.Vector2;
|
|
8
|
+
type Vector3 = math.Vector3;
|
|
9
|
+
type Vector4 = math.Vector4;
|
|
10
|
+
type Matrix3 = math.Matrix3;
|
|
11
|
+
type Matrix4 = math.Matrix4;
|
|
12
|
+
type Quaternion = math.Quaternion;
|
|
13
|
+
declare const Vector4: typeof math.Vector4, Matrix4: typeof math.Matrix4;
|
|
7
14
|
export declare class GLMaterial extends Material {
|
|
8
15
|
shader: GLShader;
|
|
9
16
|
floats: Record<string, number>;
|
|
10
17
|
ints: Record<string, number>;
|
|
11
|
-
vector2s: Record<string,
|
|
12
|
-
vector3s: Record<string,
|
|
13
|
-
vector4s: Record<string,
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
vector2s: Record<string, Vector2>;
|
|
19
|
+
vector3s: Record<string, Vector3>;
|
|
20
|
+
vector4s: Record<string, Vector4>;
|
|
21
|
+
quaternions: Record<string, Quaternion>;
|
|
22
|
+
matrices: Record<string, Matrix4>;
|
|
23
|
+
matrice3s: Record<string, Matrix3>;
|
|
16
24
|
textures: Record<string, Texture>;
|
|
17
25
|
floatArrays: Record<string, number[]>;
|
|
18
26
|
vector4Arrays: Record<string, number[]>;
|
|
@@ -82,19 +90,21 @@ export declare class GLMaterial extends Material {
|
|
|
82
90
|
setInt(name: string, value: number): void;
|
|
83
91
|
getFloats(name: string): number[] | null;
|
|
84
92
|
setFloats(name: string, value: number[]): void;
|
|
85
|
-
getVector2(name: string):
|
|
86
|
-
setVector2(name: string, value:
|
|
87
|
-
getVector3(name: string):
|
|
88
|
-
setVector3(name: string, value:
|
|
89
|
-
getVector4(name: string):
|
|
90
|
-
setVector4(name: string, value:
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
93
|
+
getVector2(name: string): Vector2 | null;
|
|
94
|
+
setVector2(name: string, value: Vector2): void;
|
|
95
|
+
getVector3(name: string): Vector3 | null;
|
|
96
|
+
setVector3(name: string, value: Vector3): void;
|
|
97
|
+
getVector4(name: string): Vector4 | null;
|
|
98
|
+
setVector4(name: string, value: Vector4): void;
|
|
99
|
+
getQuaternion(name: string): Quaternion | null;
|
|
100
|
+
setQuaternion(name: string, value: Quaternion): void;
|
|
101
|
+
getMatrix(name: string): Matrix4 | null;
|
|
102
|
+
setMatrix(name: string, value: Matrix4): void;
|
|
103
|
+
setMatrix3(name: string, value: Matrix3): void;
|
|
94
104
|
getVector4Array(name: string): number[];
|
|
95
|
-
setVector4Array(name: string, array:
|
|
105
|
+
setVector4Array(name: string, array: Vector4[]): void;
|
|
96
106
|
getMatrixArray(name: string): number[] | null;
|
|
97
|
-
setMatrixArray(name: string, array:
|
|
107
|
+
setMatrixArray(name: string, array: Matrix4[]): void;
|
|
98
108
|
setMatrixNumberArray(name: string, array: number[]): void;
|
|
99
109
|
getTexture(name: string): Texture | null;
|
|
100
110
|
setTexture(name: string, texture: Texture): void;
|
|
@@ -104,3 +114,4 @@ export declare class GLMaterial extends Material {
|
|
|
104
114
|
private checkUniform;
|
|
105
115
|
dispose(options?: MaterialDestroyOptions): void;
|
|
106
116
|
}
|
|
117
|
+
export {};
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import type { Disposable, Texture } from '@galacean/effects-core';
|
|
1
|
+
import type { Disposable, Texture, math } from '@galacean/effects-core';
|
|
2
2
|
import { GLShaderLibrary } from './gl-shader-library';
|
|
3
3
|
import type { GLEngine } from './gl-engine';
|
|
4
|
+
type Vector2 = math.Vector2;
|
|
5
|
+
type Vector3 = math.Vector3;
|
|
6
|
+
type Vector4 = math.Vector4;
|
|
7
|
+
type Matrix3 = math.Matrix3;
|
|
8
|
+
type Matrix4 = math.Matrix4;
|
|
9
|
+
type Quaternion = math.Quaternion;
|
|
4
10
|
export type Nullable<T> = T | null;
|
|
5
11
|
export declare class GLPipelineContext implements Disposable {
|
|
6
12
|
engine: GLEngine;
|
|
@@ -295,12 +301,13 @@ export declare class GLPipelineContext implements Disposable {
|
|
|
295
301
|
setFloat(uniform: Nullable<WebGLUniformLocation>, value: number): void;
|
|
296
302
|
setInt(uniform: Nullable<WebGLUniformLocation>, value: number): void;
|
|
297
303
|
setFloats(uniform: Nullable<WebGLUniformLocation>, value: number[]): void;
|
|
298
|
-
setVector2(uniform: Nullable<WebGLUniformLocation>, value:
|
|
299
|
-
setVector3(uniform: Nullable<WebGLUniformLocation>, value:
|
|
300
|
-
setVector4(uniform: Nullable<WebGLUniformLocation>, value:
|
|
304
|
+
setVector2(uniform: Nullable<WebGLUniformLocation>, value: Vector2): void;
|
|
305
|
+
setVector3(uniform: Nullable<WebGLUniformLocation>, value: Vector3): void;
|
|
306
|
+
setVector4(uniform: Nullable<WebGLUniformLocation>, value: Vector4): void;
|
|
307
|
+
setQuaternion(uniform: Nullable<WebGLUniformLocation>, value: Quaternion): void;
|
|
301
308
|
setVector4Array(uniform: Nullable<WebGLUniformLocation>, array: number[]): void;
|
|
302
|
-
setMatrix(uniform: Nullable<WebGLUniformLocation>, value:
|
|
303
|
-
setMatrix3(uniform: Nullable<WebGLUniformLocation>, value:
|
|
309
|
+
setMatrix(uniform: Nullable<WebGLUniformLocation>, value: Matrix4): void;
|
|
310
|
+
setMatrix3(uniform: Nullable<WebGLUniformLocation>, value: Matrix3): void;
|
|
304
311
|
setMatrixArray(uniform: Nullable<WebGLUniformLocation>, array: number[]): void;
|
|
305
312
|
setTexture(uniform: Nullable<WebGLUniformLocation>, channel: number, texture: Texture): void;
|
|
306
313
|
/**
|
|
@@ -314,3 +321,4 @@ export declare class GLPipelineContext implements Disposable {
|
|
|
314
321
|
private setFloat3;
|
|
315
322
|
private setFloat2;
|
|
316
323
|
}
|
|
324
|
+
export {};
|
package/dist/gl-renderer.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type { Disposable, FrameBuffer, Geometry, LostHandler, Material, Mesh, RenderFrame, RenderPass, RenderPassClearAction, RenderPassStoreAction, RestoreHandler, ShaderLibrary,
|
|
1
|
+
import type { Disposable, FrameBuffer, Geometry, LostHandler, Material, Mesh, RenderFrame, RenderPass, RenderPassClearAction, RenderPassStoreAction, RestoreHandler, ShaderLibrary, math } from '@galacean/effects-core';
|
|
2
2
|
import { Renderer, FilterMode, RenderTextureFormat } from '@galacean/effects-core';
|
|
3
3
|
import { ExtWrap } from './ext-wrap';
|
|
4
4
|
import { GLContextManager } from './gl-context-manager';
|
|
5
5
|
import { GLPipelineContext } from './gl-pipeline-context';
|
|
6
6
|
import { GLRendererInternal } from './gl-renderer-internal';
|
|
7
|
+
type Matrix4 = math.Matrix4;
|
|
7
8
|
export declare class GLRenderer extends Renderer implements Disposable {
|
|
8
9
|
readonly canvas: HTMLCanvasElement | OffscreenCanvas;
|
|
9
10
|
glRenderer: GLRendererInternal;
|
|
@@ -21,7 +22,7 @@ export declare class GLRenderer extends Renderer implements Disposable {
|
|
|
21
22
|
renderMeshes(meshes: Mesh[]): void;
|
|
22
23
|
setGlobalFloat(name: string, value: number): void;
|
|
23
24
|
setGlobalInt(name: string, value: number): void;
|
|
24
|
-
setGlobalMatrix(name: string, value:
|
|
25
|
+
setGlobalMatrix(name: string, value: Matrix4): void;
|
|
25
26
|
drawGeometry(geometry: Geometry, material: Material): void;
|
|
26
27
|
setFrameBuffer(frameBuffer: FrameBuffer | null): void;
|
|
27
28
|
getFrameBuffer(): FrameBuffer | null;
|
|
@@ -39,3 +40,4 @@ export declare class GLRenderer extends Renderer implements Disposable {
|
|
|
39
40
|
resize(width: number, height: number): void;
|
|
40
41
|
private checkGlobalUniform;
|
|
41
42
|
}
|
|
43
|
+
export {};
|
package/dist/gl-shader.d.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import type { ShaderCompileResult, ShaderWithSource, Texture, Engine } from '@galacean/effects-core';
|
|
1
|
+
import type { ShaderCompileResult, ShaderWithSource, Texture, Engine, math } from '@galacean/effects-core';
|
|
2
2
|
import { Shader } from '@galacean/effects-core';
|
|
3
3
|
import type { GLProgram } from './gl-program';
|
|
4
4
|
import type { GLPipelineContext } from './gl-pipeline-context';
|
|
5
|
+
type Vector2 = math.Vector2;
|
|
6
|
+
type Vector3 = math.Vector3;
|
|
7
|
+
type Vector4 = math.Vector4;
|
|
8
|
+
type Matrix3 = math.Matrix3;
|
|
9
|
+
type Matrix4 = math.Matrix4;
|
|
10
|
+
type Quaternion = math.Quaternion;
|
|
5
11
|
export declare class GLShader extends Shader {
|
|
6
12
|
pipelineContext: GLPipelineContext;
|
|
7
13
|
program: GLProgram;
|
|
@@ -16,13 +22,15 @@ export declare class GLShader extends Shader {
|
|
|
16
22
|
setInt(name: string, value: number): void;
|
|
17
23
|
setFloats(name: string, value: number[]): void;
|
|
18
24
|
setTexture(name: string, texture: Texture): void;
|
|
19
|
-
setVector2(name: string, value:
|
|
20
|
-
setVector3(name: string, value:
|
|
21
|
-
setVector4(name: string, value:
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
setVector2(name: string, value: Vector2): void;
|
|
26
|
+
setVector3(name: string, value: Vector3): void;
|
|
27
|
+
setVector4(name: string, value: Vector4): void;
|
|
28
|
+
setQuaternion(name: string, value: Quaternion): void;
|
|
29
|
+
setMatrix(name: string, value: Matrix4): void;
|
|
30
|
+
setMatrix3(name: string, value: Matrix3): void;
|
|
24
31
|
setVector4Array(name: string, array: number[]): void;
|
|
25
32
|
setMatrixArray(name: string, array: number[]): void;
|
|
26
33
|
fillShaderInformation(uniformNames: string[], samplers: string[]): void;
|
|
27
34
|
dispose(): void;
|
|
28
35
|
}
|
|
36
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/effects-webgl",
|
|
3
|
-
"version": "1.0.0",
|
|
3
|
+
"version": "1.1.0-alpha.0",
|
|
4
4
|
"description": "Galacean Effects runtime webgl for the web",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"registry": "https://registry.npmjs.org"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@galacean/effects-core": "1.0.0"
|
|
41
|
+
"@galacean/effects-core": "1.1.0-alpha.0"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"prebuild": "pnpm clean",
|