@galacean/engine-rhi-webgl 2.0.0-alpha.57 → 2.0.0-alpha.58
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/main.js +68 -39
- package/dist/main.js.map +1 -1
- package/dist/module.js +69 -40
- package/dist/module.js.map +1 -1
- package/package.json +3 -6
- package/types/GLCapability.d.ts +11 -2
- package/types/GLPrimitive.d.ts +1 -3
- package/types/GLRenderTarget.d.ts +1 -0
- package/types/GLTexture.d.ts +0 -4
- package/types/GLTransformFeedbackPrimitive.d.ts +1 -2
- package/types/WebGLGraphicDevice.d.ts +9 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-rhi-webgl",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.58",
|
|
4
4
|
"repository": {
|
|
5
5
|
"url": "https://github.com/galacean/engine.git"
|
|
6
6
|
},
|
|
@@ -18,11 +18,8 @@
|
|
|
18
18
|
"types/**/*"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@galacean/engine-
|
|
22
|
-
"@galacean/engine-
|
|
23
|
-
},
|
|
24
|
-
"devDependencies": {
|
|
25
|
-
"@galacean/engine-design": "2.0.0-alpha.57"
|
|
21
|
+
"@galacean/engine-math": "2.0.0-alpha.58",
|
|
22
|
+
"@galacean/engine-core": "2.0.0-alpha.58"
|
|
26
23
|
},
|
|
27
24
|
"scripts": {
|
|
28
25
|
"b:types": "tsc"
|
package/types/GLCapability.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GLCapabilityType } from "@galacean/engine-core";
|
|
1
|
+
import { GLCapabilityType, TextureFormat } from "@galacean/engine-core";
|
|
2
2
|
import { WebGLGraphicDevice } from "./WebGLGraphicDevice";
|
|
3
3
|
import { GLCompressedTextureInternalFormat } from "./type";
|
|
4
4
|
/**
|
|
@@ -10,7 +10,8 @@ export declare class GLCapability {
|
|
|
10
10
|
private _maxAntiAliasing;
|
|
11
11
|
_rhi: WebGLGraphicDevice;
|
|
12
12
|
capabilityList: Map<GLCapabilityType, boolean>;
|
|
13
|
-
get maxTextureSize():
|
|
13
|
+
get maxTextureSize(): number;
|
|
14
|
+
get maxVertexUniformVectors(): number;
|
|
14
15
|
get canUseFloatTextureBlendShape(): boolean;
|
|
15
16
|
/**
|
|
16
17
|
* Whether can use more joints.
|
|
@@ -36,6 +37,14 @@ export declare class GLCapability {
|
|
|
36
37
|
* Check if can use some compressed texture format.
|
|
37
38
|
*/
|
|
38
39
|
canIUseCompressedTextureInternalFormat(internalType: GLCompressedTextureInternalFormat): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Check whether the given texture format is supported.
|
|
42
|
+
*/
|
|
43
|
+
supportsTextureFormat(format: TextureFormat): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Check whether the given texture format can be rendered to as a color attachment.
|
|
46
|
+
*/
|
|
47
|
+
supportsRenderTargetColorFormat(format: TextureFormat): boolean;
|
|
39
48
|
/**
|
|
40
49
|
* Init capabilities.
|
|
41
50
|
*/
|
package/types/GLPrimitive.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { Primitive } from "@galacean/engine-core";
|
|
2
|
-
import { SubPrimitive } from "@galacean/engine-core/types/graphic/SubPrimitive";
|
|
3
|
-
import { IPlatformPrimitive, IPlatformShaderProgram } from "@galacean/engine-design";
|
|
1
|
+
import { IPlatformPrimitive, IPlatformShaderProgram, Primitive, SubPrimitive } from "@galacean/engine-core";
|
|
4
2
|
import { WebGLGraphicDevice } from "./WebGLGraphicDevice";
|
|
5
3
|
/**
|
|
6
4
|
* Improvement of VAO:
|
package/types/GLTexture.d.ts
CHANGED
|
@@ -15,10 +15,6 @@ export declare class GLTexture implements IPlatformTexture {
|
|
|
15
15
|
* @internal
|
|
16
16
|
*/
|
|
17
17
|
static _getRenderBufferDepthFormatDetail(format: TextureFormat, gl: WebGLRenderingContext & WebGL2RenderingContext, isWebGL2: boolean): TextureFormatDetail;
|
|
18
|
-
/**
|
|
19
|
-
* @internal
|
|
20
|
-
*/
|
|
21
|
-
static _supportRenderBufferColorFormat(format: TextureFormat, rhi: WebGLGraphicDevice): boolean;
|
|
22
18
|
/**
|
|
23
19
|
* @internal
|
|
24
20
|
*/
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { IPlatformTransformFeedbackPrimitive, VertexBufferBinding, VertexElement } from "@galacean/engine-core";
|
|
2
|
-
import type { IPlatformShaderProgram } from "@galacean/engine-design";
|
|
1
|
+
import type { IPlatformShaderProgram, IPlatformTransformFeedbackPrimitive, VertexBufferBinding, VertexElement } from "@galacean/engine-core";
|
|
3
2
|
/**
|
|
4
3
|
* @internal
|
|
5
4
|
* WebGL2 implementation of Transform Feedback primitive.
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { BufferBindFlag, BufferUsage, CameraClearFlags, Canvas, Engine, GLCapabilityType, IPlatformBuffer, IPlatformRenderTarget, IPlatformTexture2D, IPlatformTextureCube, IPlatformTransformFeedback, IPlatformTransformFeedbackPrimitive, Primitive, RenderTarget,
|
|
2
|
-
import { IHardwareRenderer, IPlatformPrimitive, IPlatformShaderProgram } from "@galacean/engine-design";
|
|
1
|
+
import { BufferBindFlag, BufferUsage, CameraClearFlags, Canvas, Engine, GLCapabilityType, IHardwareRenderer, IPlatformBuffer, IPlatformPrimitive, IPlatformRenderTarget, IPlatformShaderProgram, IPlatformTexture, IPlatformTexture2D, IPlatformTextureCube, IPlatformTransformFeedback, IPlatformTransformFeedbackPrimitive, Primitive, RenderTarget, SubPrimitive, Texture2D, Texture2DArray, TextureCube, TextureCubeFace, TextureFormat } from "@galacean/engine-core";
|
|
3
2
|
import { Color, Vector4 } from "@galacean/engine-math";
|
|
4
3
|
import { GLCapability } from "./GLCapability";
|
|
5
|
-
import { GLPrimitive } from "./GLPrimitive";
|
|
6
4
|
import { GLRenderStates } from "./GLRenderStates";
|
|
7
|
-
import { GLTexture } from "./GLTexture";
|
|
8
5
|
import { GLTexture2DArray } from "./GLTexture2DArray";
|
|
9
6
|
import { WebGLExtension } from "./type";
|
|
10
7
|
/**
|
|
@@ -50,6 +47,7 @@ export interface WebGLGraphicDeviceOptions {
|
|
|
50
47
|
* WebGL graphic device, including WebGL1.0 and WebGL2.0.
|
|
51
48
|
*/
|
|
52
49
|
export declare class WebGLGraphicDevice implements IHardwareRenderer {
|
|
50
|
+
readonly supportsRendering = true;
|
|
53
51
|
maxUniformBlockSize: number;
|
|
54
52
|
/** @internal */
|
|
55
53
|
_readFrameBuffer: WebGLFramebuffer | null;
|
|
@@ -62,8 +60,9 @@ export declare class WebGLGraphicDevice implements IHardwareRenderer {
|
|
|
62
60
|
/** @internal */
|
|
63
61
|
_enableGlobalDepthBias: boolean;
|
|
64
62
|
/** @internal */
|
|
65
|
-
_currentBindShaderProgram:
|
|
66
|
-
|
|
63
|
+
_currentBindShaderProgram: IPlatformShaderProgram | null;
|
|
64
|
+
/** @internal */
|
|
65
|
+
readonly _options: WebGLGraphicDeviceOptions;
|
|
67
66
|
private _webGLOptions;
|
|
68
67
|
private _gl;
|
|
69
68
|
private _renderStates;
|
|
@@ -118,18 +117,20 @@ export declare class WebGLGraphicDevice implements IHardwareRenderer {
|
|
|
118
117
|
requireExtension(ext: any): any;
|
|
119
118
|
canIUse(capabilityType: GLCapabilityType): boolean;
|
|
120
119
|
canIUseCompressedTextureInternalFormat(type: number): boolean;
|
|
120
|
+
supportsTextureFormat(format: TextureFormat): boolean;
|
|
121
|
+
supportsRenderTargetColorFormat(format: TextureFormat): boolean;
|
|
121
122
|
viewport(x: number, y: number, width: number, height: number): void;
|
|
122
123
|
scissor(x: number, y: number, width: number, height: number): void;
|
|
123
124
|
colorMask(r: boolean, g: boolean, b: boolean, a: boolean): void;
|
|
124
125
|
clearRenderTarget(engine: Engine, clearFlags: CameraClearFlags, clearColor?: Color): void;
|
|
125
|
-
drawPrimitive(primitive:
|
|
126
|
+
drawPrimitive(primitive: Primitive, subPrimitive: SubPrimitive | null, shaderProgram: IPlatformShaderProgram): void;
|
|
126
127
|
getMainFrameBufferWidth(): number;
|
|
127
128
|
getMainFrameBufferHeight(): number;
|
|
128
129
|
activeRenderTarget(renderTarget: RenderTarget | null, viewport: Vector4, isFlipProjection: boolean, mipLevel?: number, faceIndex?: TextureCubeFace): void;
|
|
129
130
|
blitInternalRTByBlitFrameBuffer(srcRT: RenderTarget | null, destRT: RenderTarget, clearFlags: CameraClearFlags, viewport: Vector4): void;
|
|
130
131
|
copyRenderTargetToSubTexture(srcRT: RenderTarget | null, grabTexture: Texture2D, viewport: Vector4): void;
|
|
131
132
|
activeTexture(textureID: number): void;
|
|
132
|
-
bindTexture(
|
|
133
|
+
bindTexture(platformTexture: IPlatformTexture): void;
|
|
133
134
|
setGlobalDepthBias(bias: number, slopeBias: number): void;
|
|
134
135
|
flush(): void;
|
|
135
136
|
forceLoseDevice(): void;
|