@galacean/engine-rhi-webgl 0.9.0-beta.80
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/LICENSE +21 -0
- package/README.md +1 -0
- package/dist/main.js +1927 -0
- package/dist/main.js.map +1 -0
- package/dist/miniprogram.js +1927 -0
- package/dist/module.js +1921 -0
- package/dist/module.js.map +1 -0
- package/package.json +27 -0
- package/types/GLBuffer.d.ts +16 -0
- package/types/GLCapability.d.ts +52 -0
- package/types/GLExtensions.d.ts +14 -0
- package/types/GLPrimitive.d.ts +1 -0
- package/types/GLRenderStates.d.ts +15 -0
- package/types/GLRenderTarget.d.ts +39 -0
- package/types/GLTexture.d.ts +54 -0
- package/types/GLTexture2D.d.ts +23 -0
- package/types/GLTexture2DArray.d.ts +21 -0
- package/types/GLTextureCube.d.ts +23 -0
- package/types/WebCanvas.d.ts +45 -0
- package/types/WebGLEngine.d.ts +20 -0
- package/types/WebGLGraphicDevice.d.ts +86 -0
- package/types/WebGLRenderer.d.ts +77 -0
- package/types/index.d.ts +5 -0
- package/types/type.d.ts +83 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { IPlatformTexture, Texture, TextureCubeFace, TextureDepthCompareFunction, TextureFilterMode, TextureWrapMode } from "@galacean/engine-core";
|
|
2
|
+
import { WebGLRenderer } from "./WebGLRenderer";
|
|
3
|
+
/**
|
|
4
|
+
* Texture in WebGL platform.
|
|
5
|
+
*/
|
|
6
|
+
export declare class GLTexture implements IPlatformTexture {
|
|
7
|
+
/**
|
|
8
|
+
* Wrapping mode for texture coordinate S.
|
|
9
|
+
*/
|
|
10
|
+
set wrapModeU(value: TextureWrapMode);
|
|
11
|
+
/**
|
|
12
|
+
* Wrapping mode for texture coordinate T.
|
|
13
|
+
*/
|
|
14
|
+
set wrapModeV(value: TextureWrapMode);
|
|
15
|
+
/**
|
|
16
|
+
* Filter mode for texture.
|
|
17
|
+
*/
|
|
18
|
+
set filterMode(value: TextureFilterMode);
|
|
19
|
+
/**
|
|
20
|
+
* Anisotropic level for texture.
|
|
21
|
+
*/
|
|
22
|
+
set anisoLevel(value: number);
|
|
23
|
+
set depthCompareFunction(value: TextureDepthCompareFunction);
|
|
24
|
+
/**
|
|
25
|
+
* Create texture in WebGL platform.
|
|
26
|
+
*/
|
|
27
|
+
constructor(rhi: WebGLRenderer, texture: Texture, target: GLenum);
|
|
28
|
+
/**
|
|
29
|
+
* Destroy texture.
|
|
30
|
+
*/
|
|
31
|
+
destroy(): void;
|
|
32
|
+
/**
|
|
33
|
+
* Generate multi-level textures based on the 0th level data.
|
|
34
|
+
*/
|
|
35
|
+
generateMipmaps(): void;
|
|
36
|
+
protected _bind(): void;
|
|
37
|
+
/**
|
|
38
|
+
* Pre-development mipmapping GPU memory.
|
|
39
|
+
*/
|
|
40
|
+
protected _init(isCube: boolean): void;
|
|
41
|
+
/**
|
|
42
|
+
* Get the pixel color buffer according to the specified cube face and area.
|
|
43
|
+
* @param face - You can choose which cube face to read
|
|
44
|
+
* @param x - X coordinate of area start
|
|
45
|
+
* @param y - Y coordinate of area start
|
|
46
|
+
* @param width - Area width
|
|
47
|
+
* @param height - Area height
|
|
48
|
+
* @param out - Color buffer
|
|
49
|
+
* @param mipLevel - Set mip level the data want to get from
|
|
50
|
+
*/
|
|
51
|
+
protected _getPixelBuffer(face: TextureCubeFace | null, x: number, y: number, width: number, height: number, mipLevel: number, out: ArrayBufferView): void;
|
|
52
|
+
private _setWrapMode;
|
|
53
|
+
protected _getReadFrameBuffer(): WebGLFramebuffer;
|
|
54
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IPlatformTexture2D, Texture2D } from "@galacean/engine-core";
|
|
2
|
+
import { GLTexture } from "./GLTexture";
|
|
3
|
+
import { WebGLRenderer } from "./WebGLRenderer";
|
|
4
|
+
/**
|
|
5
|
+
* Texture 2d in WebGL platform.
|
|
6
|
+
*/
|
|
7
|
+
export declare class GLTexture2D extends GLTexture implements IPlatformTexture2D {
|
|
8
|
+
/** Backward compatible with WebGL1.0. */
|
|
9
|
+
private _compressedMipFilled;
|
|
10
|
+
constructor(rhi: WebGLRenderer, texture2D: Texture2D);
|
|
11
|
+
/**
|
|
12
|
+
* {@inheritDoc IPlatformTexture2D.setPixelBuffer}
|
|
13
|
+
*/
|
|
14
|
+
setPixelBuffer(colorBuffer: ArrayBufferView, mipLevel: number, x: number, y: number, width?: number, height?: number): void;
|
|
15
|
+
/**
|
|
16
|
+
* {@inheritDoc IPlatformTexture2D.setImageSource}
|
|
17
|
+
*/
|
|
18
|
+
setImageSource(imageSource: TexImageSource, mipLevel: number, flipY: boolean, premultiplyAlpha: boolean, x: number, y: number): void;
|
|
19
|
+
/**
|
|
20
|
+
* {@inheritDoc IPlatformTexture2D.getPixelBuffer }
|
|
21
|
+
*/
|
|
22
|
+
getPixelBuffer(x: number, y: number, width: number, height: number, mipLevel: number, out: ArrayBufferView): void;
|
|
23
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IPlatformTexture2DArray, Texture2DArray } from "@galacean/engine-core";
|
|
2
|
+
import { GLTexture } from "./GLTexture";
|
|
3
|
+
import { WebGLRenderer } from "./WebGLRenderer";
|
|
4
|
+
/**
|
|
5
|
+
* Texture 2D array in WebGL platform.
|
|
6
|
+
*/
|
|
7
|
+
export declare class GLTexture2DArray extends GLTexture implements IPlatformTexture2DArray {
|
|
8
|
+
constructor(rhi: WebGLRenderer, texture2DArray: Texture2DArray);
|
|
9
|
+
/**
|
|
10
|
+
* {@inheritDoc IPlatformTexture2DArray.setPixelBuffer}
|
|
11
|
+
*/
|
|
12
|
+
setPixelBuffer(offsetIndex: number, colorBuffer: ArrayBufferView, mipLevel: number, x: number, y: number, width?: number, height?: number, length?: number): void;
|
|
13
|
+
/**
|
|
14
|
+
* {@inheritDoc IPlatformTexture2DArray.setImageSource}
|
|
15
|
+
*/
|
|
16
|
+
setImageSource(elementIndex: number, imageSource: TexImageSource, mipLevel: number, flipY: boolean, premultiplyAlpha: boolean, x: number, y: number): void;
|
|
17
|
+
/**
|
|
18
|
+
* {@inheritDoc IPlatformTexture2DArray.getPixelBuffer}
|
|
19
|
+
*/
|
|
20
|
+
getPixelBuffer(elementIndex: number, x: number, y: number, width: number, height: number, mipLevel: number, out: ArrayBufferView): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IPlatformTextureCube, TextureCube, TextureCubeFace } from "@galacean/engine-core";
|
|
2
|
+
import { GLTexture } from "./GLTexture";
|
|
3
|
+
import { WebGLRenderer } from "./WebGLRenderer";
|
|
4
|
+
/**
|
|
5
|
+
* Cube texture in WebGL platform.
|
|
6
|
+
*/
|
|
7
|
+
export declare class GLTextureCube extends GLTexture implements IPlatformTextureCube {
|
|
8
|
+
/** Backward compatible with WebGL1.0. */
|
|
9
|
+
private _compressedFaceFilled;
|
|
10
|
+
constructor(rhi: WebGLRenderer, textureCube: TextureCube);
|
|
11
|
+
/**
|
|
12
|
+
* {@inheritDoc IPlatformTextureCube.setPixelBuffer}
|
|
13
|
+
*/
|
|
14
|
+
setPixelBuffer(face: TextureCubeFace, colorBuffer: ArrayBufferView, mipLevel: number, x: number, y: number, width?: number, height?: number): void;
|
|
15
|
+
/**
|
|
16
|
+
* {@inheritDoc IPlatformTextureCube.setImageSource}
|
|
17
|
+
*/
|
|
18
|
+
setImageSource(face: TextureCubeFace, imageSource: TexImageSource, mipLevel: number, flipY: boolean, premultiplyAlpha: boolean, x: number, y: number): void;
|
|
19
|
+
/**
|
|
20
|
+
* {@inheritDoc IPlatformTextureCube.getPixelBuffer}
|
|
21
|
+
*/
|
|
22
|
+
getPixelBuffer(face: TextureCubeFace, x: number, y: number, width: number, height: number, mipLevel: number, out: ArrayBufferView): void;
|
|
23
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Canvas } from "@galacean/engine-core";
|
|
2
|
+
import { Vector2 } from "@galacean/engine-math";
|
|
3
|
+
type OffscreenCanvas = any;
|
|
4
|
+
/**
|
|
5
|
+
* The canvas used on the web, which can support HTMLCanvasElement and OffscreenCanvas.
|
|
6
|
+
*/
|
|
7
|
+
export declare class WebCanvas implements Canvas {
|
|
8
|
+
_webCanvas: HTMLCanvasElement | OffscreenCanvas;
|
|
9
|
+
private _width;
|
|
10
|
+
private _height;
|
|
11
|
+
private _scale;
|
|
12
|
+
/**
|
|
13
|
+
* @inheritdoc
|
|
14
|
+
*/
|
|
15
|
+
get width(): number;
|
|
16
|
+
set width(value: number);
|
|
17
|
+
/**
|
|
18
|
+
* @inheritdoc
|
|
19
|
+
*/
|
|
20
|
+
get height(): number;
|
|
21
|
+
set height(value: number);
|
|
22
|
+
/**
|
|
23
|
+
* The scale of canvas, the value is visible width/height divide the render width/height.
|
|
24
|
+
* @remarks Need to re-assign after modification to ensure that the modification takes effect.
|
|
25
|
+
*/
|
|
26
|
+
get scale(): Vector2;
|
|
27
|
+
set scale(value: Vector2);
|
|
28
|
+
/**
|
|
29
|
+
* Resize the rendering size according to the clientWidth and clientHeight of the canvas.
|
|
30
|
+
* @param pixelRatio - Pixel ratio
|
|
31
|
+
*/
|
|
32
|
+
resizeByClientSize(pixelRatio?: number): void;
|
|
33
|
+
/**
|
|
34
|
+
* Create a web canvas.
|
|
35
|
+
* @param webCanvas - Web native canvas
|
|
36
|
+
*/
|
|
37
|
+
constructor(webCanvas: HTMLCanvasElement | OffscreenCanvas);
|
|
38
|
+
/**
|
|
39
|
+
* Set scale.
|
|
40
|
+
* @param x - Scale along the X axis
|
|
41
|
+
* @param y - Scale along the Y axis
|
|
42
|
+
*/
|
|
43
|
+
setScale(x: number, y: number): void;
|
|
44
|
+
}
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Engine } from "@galacean/engine-core";
|
|
2
|
+
import { WebCanvas } from "./WebCanvas";
|
|
3
|
+
import { WebGLRendererOptions } from "./WebGLRenderer";
|
|
4
|
+
type OffscreenCanvas = any;
|
|
5
|
+
/**
|
|
6
|
+
* WebGL platform engine,support includes WebGL1.0 and WebGL2.0.
|
|
7
|
+
*/
|
|
8
|
+
export declare class WebGLEngine extends Engine {
|
|
9
|
+
/**
|
|
10
|
+
* Create an engine suitable for the WebGL platform.
|
|
11
|
+
* @param canvas - Native web canvas
|
|
12
|
+
* @param webGLRendererOptions - WebGL renderer options
|
|
13
|
+
*/
|
|
14
|
+
constructor(canvas: string | HTMLCanvasElement | OffscreenCanvas, webGLRendererOptions?: WebGLRendererOptions);
|
|
15
|
+
/**
|
|
16
|
+
* Web canvas.
|
|
17
|
+
*/
|
|
18
|
+
get canvas(): WebCanvas;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { BufferBindFlag, BufferUsage, CameraClearFlags, Canvas, Engine, GLCapabilityType, IHardwareRenderer, IPlatformBuffer, IPlatformRenderTarget, IPlatformTexture2D, IPlatformTextureCube, Mesh, RenderTarget, SubMesh, Texture2D, Texture2DArray, TextureCube } from "@oasis-engine/core";
|
|
2
|
+
import { IPlatformPrimitive } from "@oasis-engine/design";
|
|
3
|
+
import { Color, Vector4 } from "@oasis-engine/math";
|
|
4
|
+
import { GLCapability } from "./GLCapability";
|
|
5
|
+
import { GLRenderStates } from "./GLRenderStates";
|
|
6
|
+
import { GLTexture } from "./GLTexture";
|
|
7
|
+
import { GLTexture2DArray } from "./GLTexture2DArray";
|
|
8
|
+
import { WebGLExtension } from "./type";
|
|
9
|
+
/**
|
|
10
|
+
* WebGL mode.
|
|
11
|
+
*/
|
|
12
|
+
export declare enum WebGLMode {
|
|
13
|
+
/** Auto, use WebGL2.0 if support, or will fallback to WebGL1.0. */
|
|
14
|
+
Auto = 0,
|
|
15
|
+
/** WebGL2.0. */
|
|
16
|
+
WebGL2 = 1,
|
|
17
|
+
/** WebGL1.0, */
|
|
18
|
+
WebGL1 = 2
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* WebGL graphic device options.
|
|
22
|
+
*/
|
|
23
|
+
export interface WebGLGraphicDeviceOptions extends WebGLContextAttributes {
|
|
24
|
+
/** WebGL mode.*/
|
|
25
|
+
webGLMode?: WebGLMode;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* WebGL graphic device, including WebGL1.0 and WebGL2.0.
|
|
29
|
+
*/
|
|
30
|
+
export declare class WebGLGraphicDevice implements IHardwareRenderer {
|
|
31
|
+
private _options;
|
|
32
|
+
private _gl;
|
|
33
|
+
private _renderStates;
|
|
34
|
+
private _extensions;
|
|
35
|
+
private _capability;
|
|
36
|
+
private _isWebGL2;
|
|
37
|
+
private _renderer;
|
|
38
|
+
private _webCanvas;
|
|
39
|
+
private _activeTextureID;
|
|
40
|
+
private _activeTextures;
|
|
41
|
+
private _lastViewport;
|
|
42
|
+
private _lastScissor;
|
|
43
|
+
private _lastClearColor;
|
|
44
|
+
private _scissorEnable;
|
|
45
|
+
private _onDeviceLost;
|
|
46
|
+
private _onDeviceRestored;
|
|
47
|
+
get isWebGL2(): boolean;
|
|
48
|
+
get renderer(): string;
|
|
49
|
+
/**
|
|
50
|
+
* GL Context
|
|
51
|
+
* @member {WebGLRenderingContext}
|
|
52
|
+
*/
|
|
53
|
+
get gl(): (WebGLRenderingContext & WebGLExtension) | WebGL2RenderingContext;
|
|
54
|
+
get renderStates(): GLRenderStates;
|
|
55
|
+
get capability(): GLCapability;
|
|
56
|
+
get canIUseMoreJoints(): boolean;
|
|
57
|
+
constructor(initializeOptions?: WebGLGraphicDeviceOptions);
|
|
58
|
+
init(canvas: Canvas, onDeviceLost: () => void, onDeviceRestored: () => void): void;
|
|
59
|
+
createPlatformPrimitive(primitive: Mesh): IPlatformPrimitive;
|
|
60
|
+
createPlatformTexture2D(texture2D: Texture2D): IPlatformTexture2D;
|
|
61
|
+
createPlatformTexture2DArray(texture2D: Texture2DArray): GLTexture2DArray;
|
|
62
|
+
createPlatformTextureCube(textureCube: TextureCube): IPlatformTextureCube;
|
|
63
|
+
createPlatformRenderTarget(target: RenderTarget): IPlatformRenderTarget;
|
|
64
|
+
createPlatformBuffer(type: BufferBindFlag, byteLength: number, bufferUsage?: BufferUsage, data?: ArrayBuffer | ArrayBufferView): IPlatformBuffer;
|
|
65
|
+
requireExtension(ext: any): any;
|
|
66
|
+
canIUse(capabilityType: GLCapabilityType): boolean;
|
|
67
|
+
canIUseCompressedTextureInternalFormat(type: number): boolean;
|
|
68
|
+
viewport(x: number, y: number, width: number, height: number): void;
|
|
69
|
+
scissor(x: number, y: number, width: number, height: number): void;
|
|
70
|
+
colorMask(r: boolean, g: boolean, b: boolean, a: boolean): void;
|
|
71
|
+
clearRenderTarget(engine: Engine, clearFlags: CameraClearFlags, clearColor: Color): void;
|
|
72
|
+
drawPrimitive(primitive: Mesh, subPrimitive: SubMesh, shaderProgram: any): void;
|
|
73
|
+
activeRenderTarget(renderTarget: RenderTarget, viewport: Vector4, mipLevel: number): void;
|
|
74
|
+
activeTexture(textureID: number): void;
|
|
75
|
+
bindTexture(texture: GLTexture): void;
|
|
76
|
+
setGlobalDepthBias(bias: number, slopeBias: number): void;
|
|
77
|
+
flush(): void;
|
|
78
|
+
forceLoseDevice(): void;
|
|
79
|
+
forceRestoreDevice(): void;
|
|
80
|
+
resetState(): void;
|
|
81
|
+
protected _initGLState(gl: (WebGLRenderingContext & WebGLExtension) | WebGL2RenderingContext): void;
|
|
82
|
+
destroy(): void;
|
|
83
|
+
private _onContextCreationError;
|
|
84
|
+
private _onWebGLContextLost;
|
|
85
|
+
private _onWebGLContextRestored;
|
|
86
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { CameraClearFlags, Canvas, Engine, GLCapabilityType, IHardwareRenderer, IPlatformRenderTarget, IPlatformTexture2D, IPlatformTextureCube, Mesh, RenderTarget, SubMesh, Texture2D, Texture2DArray, TextureCube } from "@galacean/engine-core";
|
|
2
|
+
import { IPlatformPrimitive } from "@galacean/engine-design";
|
|
3
|
+
import { Color, Vector4 } from "@galacean/engine-math";
|
|
4
|
+
import { GLCapability } from "./GLCapability";
|
|
5
|
+
import { GLRenderStates } from "./GLRenderStates";
|
|
6
|
+
import { GLTexture } from "./GLTexture";
|
|
7
|
+
import { GLTexture2DArray } from "./GLTexture2DArray";
|
|
8
|
+
import { WebGLExtension } from "./type";
|
|
9
|
+
/**
|
|
10
|
+
* WebGL mode.
|
|
11
|
+
*/
|
|
12
|
+
export declare enum WebGLMode {
|
|
13
|
+
/** Auto, use WebGL2.0 if support, or will fallback to WebGL1.0. */
|
|
14
|
+
Auto = 0,
|
|
15
|
+
/** WebGL2.0. */
|
|
16
|
+
WebGL2 = 1,
|
|
17
|
+
/** WebGL1.0, */
|
|
18
|
+
WebGL1 = 2
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* WebGL renderer options.
|
|
22
|
+
*/
|
|
23
|
+
export interface WebGLRendererOptions extends WebGLContextAttributes {
|
|
24
|
+
/** WebGL mode.*/
|
|
25
|
+
webGLMode?: WebGLMode;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* WebGL renderer, including WebGL1.0 and WebGL2.0.
|
|
29
|
+
*/
|
|
30
|
+
export declare class WebGLRenderer implements IHardwareRenderer {
|
|
31
|
+
_currentBind: any;
|
|
32
|
+
private _options;
|
|
33
|
+
private _gl;
|
|
34
|
+
private _renderStates;
|
|
35
|
+
private _extensions;
|
|
36
|
+
private _capability;
|
|
37
|
+
private _isWebGL2;
|
|
38
|
+
private _renderer;
|
|
39
|
+
private _webCanvas;
|
|
40
|
+
private _activeTextureID;
|
|
41
|
+
private _activeTextures;
|
|
42
|
+
private _lastViewport;
|
|
43
|
+
private _lastScissor;
|
|
44
|
+
private _lastClearColor;
|
|
45
|
+
private _scissorEnable;
|
|
46
|
+
get isWebGL2(): boolean;
|
|
47
|
+
get renderer(): string;
|
|
48
|
+
/**
|
|
49
|
+
* GL Context
|
|
50
|
+
* @member {WebGLRenderingContext}
|
|
51
|
+
*/
|
|
52
|
+
get gl(): (WebGLRenderingContext & WebGLExtension) | WebGL2RenderingContext;
|
|
53
|
+
get renderStates(): GLRenderStates;
|
|
54
|
+
get capability(): GLCapability;
|
|
55
|
+
get canIUseMoreJoints(): boolean;
|
|
56
|
+
constructor(initializeOptions?: WebGLRendererOptions);
|
|
57
|
+
init(canvas: Canvas): void;
|
|
58
|
+
createPlatformPrimitive(primitive: Mesh): IPlatformPrimitive;
|
|
59
|
+
createPlatformTexture2D(texture2D: Texture2D): IPlatformTexture2D;
|
|
60
|
+
createPlatformTexture2DArray(texture2D: Texture2DArray): GLTexture2DArray;
|
|
61
|
+
createPlatformTextureCube(textureCube: TextureCube): IPlatformTextureCube;
|
|
62
|
+
createPlatformRenderTarget(target: RenderTarget): IPlatformRenderTarget;
|
|
63
|
+
requireExtension(ext: any): any;
|
|
64
|
+
canIUse(capabilityType: GLCapabilityType): boolean;
|
|
65
|
+
canIUseCompressedTextureInternalFormat(type: number): boolean;
|
|
66
|
+
viewport(x: number, y: number, width: number, height: number): void;
|
|
67
|
+
scissor(x: number, y: number, width: number, height: number): void;
|
|
68
|
+
colorMask(r: any, g: any, b: any, a: any): void;
|
|
69
|
+
clearRenderTarget(engine: Engine, clearFlags: CameraClearFlags, clearColor: Color): void;
|
|
70
|
+
drawPrimitive(primitive: Mesh, subPrimitive: SubMesh, shaderProgram: any): void;
|
|
71
|
+
activeRenderTarget(renderTarget: RenderTarget, viewport: Vector4, mipLevel: number): void;
|
|
72
|
+
activeTexture(textureID: number): void;
|
|
73
|
+
bindTexture(texture: GLTexture): void;
|
|
74
|
+
setGlobalDepthBias(bias: number, slopeBias: number): void;
|
|
75
|
+
flush(): void;
|
|
76
|
+
destroy(): void;
|
|
77
|
+
}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { GLCompressedTextureInternalFormat } from "./type";
|
|
2
|
+
export { WebCanvas } from "./WebCanvas";
|
|
3
|
+
export { WebGLEngine } from "./WebGLEngine";
|
|
4
|
+
export { WebGLMode, WebGLRenderer } from "./WebGLRenderer";
|
|
5
|
+
export type { WebGLRendererOptions } from "./WebGLRenderer";
|
package/types/type.d.ts
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Smoothing plug-in.
|
|
3
|
+
* */
|
|
4
|
+
export interface WebGLExtension {
|
|
5
|
+
MAX_DRAW_BUFFERS: GLenum;
|
|
6
|
+
UNSIGNED_INT_24_8: GLenum;
|
|
7
|
+
MAX_SAMPLES: GLenum;
|
|
8
|
+
RGBA8: GLenum;
|
|
9
|
+
RGBA16F: GLenum;
|
|
10
|
+
RGBA32F: GLenum;
|
|
11
|
+
DEPTH_COMPONENT32F: GLenum;
|
|
12
|
+
READ_FRAMEBUFFER: GLenum;
|
|
13
|
+
DRAW_FRAMEBUFFER: GLenum;
|
|
14
|
+
createVertexArray(): WebGLVertexArrayObject | null;
|
|
15
|
+
deleteVertexArray(vertexArray: WebGLVertexArrayObject | null): void;
|
|
16
|
+
isVertexArray(vertexArray: WebGLVertexArrayObject | null): GLboolean;
|
|
17
|
+
bindVertexArray(array: WebGLVertexArrayObject | null): void;
|
|
18
|
+
renderbufferStorageMultisample(target: GLenum, samples: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei): void;
|
|
19
|
+
blitFramebuffer(srcX0: GLint, srcY0: GLint, srcX1: GLint, srcY1: GLint, dstX0: GLint, dstY0: GLint, dstX1: GLint, dstY1: GLint, mask: GLbitfield, filter: GLenum): void;
|
|
20
|
+
drawArraysInstanced(mode: GLenum, first: GLint, count: GLsizei, instanceCount: GLsizei): void;
|
|
21
|
+
drawElementsInstanced(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, instanceCount: GLsizei): void;
|
|
22
|
+
vertexAttribDivisor(index: GLuint, divisor: GLuint): void;
|
|
23
|
+
drawBuffers(buffers: Iterable<GLenum>): void;
|
|
24
|
+
}
|
|
25
|
+
export interface TextureFormatDetail {
|
|
26
|
+
internalFormat: GLint;
|
|
27
|
+
baseFormat?: GLenum;
|
|
28
|
+
dataType?: GLenum;
|
|
29
|
+
isCompressed: boolean;
|
|
30
|
+
attachment?: GLenum;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated
|
|
34
|
+
*/
|
|
35
|
+
export declare enum GLCompressedTextureInternalFormat {
|
|
36
|
+
RGBA_ASTC_4X4_KHR = 37808,
|
|
37
|
+
RGBA_ASTC_5X4_KHR = 37809,
|
|
38
|
+
RGBA_ASTC_5X5_KHR = 37810,
|
|
39
|
+
RGBA_ASTC_6X5_KHR = 37811,
|
|
40
|
+
RGBA_ASTC_6X6_KHR = 37812,
|
|
41
|
+
RGBA_ASTC_8X5_KHR = 37813,
|
|
42
|
+
RGBA_ASTC_8X6_KHR = 37814,
|
|
43
|
+
RGBA_ASTC_8X8_KHR = 37815,
|
|
44
|
+
RGBA_ASTC_10X5_KHR = 37816,
|
|
45
|
+
RGBA_ASTC_10X6_KHR = 37817,
|
|
46
|
+
RGBA_ASTC_10X8_KHR = 37818,
|
|
47
|
+
RGBA_ASTC_10X10_KHR = 37819,
|
|
48
|
+
RGBA_ASTC_12X10_KHR = 37820,
|
|
49
|
+
RGBA_ASTC_12X12_KHR = 37821,
|
|
50
|
+
SRGB8_ALPHA8_ASTC_4X4_KHR = 37840,
|
|
51
|
+
SRGB8_ALPHA8_ASTC_5X4_KHR = 37841,
|
|
52
|
+
SRGB8_ALPHA8_ASTC_5X5_KHR = 37842,
|
|
53
|
+
SRGB8_ALPHA8_ASTC_6X5_KHR = 37843,
|
|
54
|
+
SRGB8_ALPHA8_ASTC_6X6_KHR = 37844,
|
|
55
|
+
SRGB8_ALPHA8_ASTC_8X5_KHR = 37845,
|
|
56
|
+
SRGB8_ALPHA8_ASTC_8X6_KHR = 37846,
|
|
57
|
+
SRGB8_ALPHA8_ASTC_8X8_KHR = 37847,
|
|
58
|
+
SRGB8_ALPHA8_ASTC_10X5_KHR = 37848,
|
|
59
|
+
SRGB8_ALPHA8_ASTC_10X6_KHR = 37849,
|
|
60
|
+
SRGB8_ALPHA8_ASTC_10X8_KHR = 37850,
|
|
61
|
+
SRGB8_ALPHA8_ASTC_10X10_KHR = 37851,
|
|
62
|
+
SRGB8_ALPHA8_ASTC_12X10_KHR = 37852,
|
|
63
|
+
SRGB8_ALPHA8_ASTC_12X12_KHR = 37853,
|
|
64
|
+
RGB_ETC1_WEBGL = 36196,
|
|
65
|
+
R11_EAC = 37488,
|
|
66
|
+
SIGNED_R11_EAC = 37489,
|
|
67
|
+
RG11_EAC = 37490,
|
|
68
|
+
SIGNED_RG11_EAC = 37491,
|
|
69
|
+
RGB8_ETC2 = 37492,
|
|
70
|
+
SRGB8_ETC2 = 37493,
|
|
71
|
+
RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37494,
|
|
72
|
+
SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37495,
|
|
73
|
+
RGBA8_ETC2_EAC = 37496,
|
|
74
|
+
SRGB8_ALPHA8_ETC2_EAC = 37497,
|
|
75
|
+
RGB_PVRTC_4BPPV1_IMG = 35840,
|
|
76
|
+
RGB_PVRTC_2BPPV1_IMG = 35841,
|
|
77
|
+
RGBA_PVRTC_4BPPV1_IMG = 35842,
|
|
78
|
+
RGBA_PVRTC_2BPPV1_IMG = 35843,
|
|
79
|
+
RGB_S3TC_DXT1_EXT = 33776,
|
|
80
|
+
RGBA_S3TC_DXT1_EXT = 33777,
|
|
81
|
+
RGBA_S3TC_DXT3_EXT = 33778,
|
|
82
|
+
RGBA_S3TC_DXT5_EXT = 33779
|
|
83
|
+
}
|