Skip to content

Commit 974c343

Browse files
authored
Merge pull request #17669 from linbingquan/dev-ts
TS: Clean up WebGLGeometries, WebGLIndexedBufferRenderer, WebGLInfo, WebGLLights, WebGLObjects, WebGLShader, WebGLTextures, WebGLUniforms.
2 parents aa701f7 + 4e34506 commit 974c343

File tree

8 files changed

+88
-24
lines changed

8 files changed

+88
-24
lines changed
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
export class WebGLGeometries {
22

3-
constructor( gl: WebGLRenderingContext, extensions: any, _infoRender: any );
3+
constructor( gl: WebGLRenderingContext, attributes: any, info: any );
44

5-
get( object: any ): any;
5+
get( object: any, geometry: any ): any;
6+
update( geometry: any ): any;
7+
getWireframeAttribute( geometry: any ): any;
68

79
}
Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
export class WebGLIndexedBufferRenderer {
22

3-
constructor( gl: WebGLRenderingContext, properties: any, info: any );
3+
constructor(
4+
gl: WebGLRenderingContext,
5+
extensions: any,
6+
info: any,
7+
capabilities: any
8+
);
49

510
setMode( value: any ): void;
611
setIndex( index: any ): void;
712
render( start: any, count: number ): void;
8-
renderInstances( geometry: any, start: any, count: number ): void;
9-
13+
renderInstances(
14+
geometry: any,
15+
start: any,
16+
count: number,
17+
primcount: number
18+
): void;
1019
}

src/renderers/webgl/WebGLInfo.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { WebGLProgram } from './WebGLProgram';
55
*/
66
export class WebGLInfo {
77

8+
constructor( gl: WebGLRenderingContext );
9+
810
autoReset: boolean;
911
memory: {
1012
geometries: number;
@@ -18,6 +20,7 @@ export class WebGLInfo {
1820
points: number;
1921
triangles: number;
2022
};
23+
update( count: any, mode: any, instanceCount: any ): void;
2124
reset(): void;
2225

2326
}

src/renderers/webgl/WebGLLights.d.ts

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,40 @@ export class WebGLLights {
22

33
constructor( gl: WebGLRenderingContext, properties: any, info: any );
44

5-
get( light: any ): any;
5+
state: {
6+
version: number;
7+
8+
hash: {
9+
directionalLength: number;
10+
pointLength: number;
11+
spotLength: number;
12+
rectAreaLength: number;
13+
hemiLength: number;
14+
15+
numDirectionalShadows: number;
16+
numPointShadows: number;
17+
numSpotShadows: number;
18+
};
619

20+
ambient: Array<number>;
21+
probe: Array<any>;
22+
directional: Array<any>;
23+
directionalShadowMap: Array<any>;
24+
directionalShadowMatrix: Array<any>;
25+
spot: Array<any>;
26+
spotShadowMap: Array<any>;
27+
spotShadowMatrix: Array<any>;
28+
rectArea: Array<any>;
29+
point: Array<any>;
30+
pointShadowMap: Array<any>;
31+
pointShadowMatrix: Array<any>;
32+
hemi: Array<any>;
33+
34+
numDirectionalShadows: number;
35+
numPointShadows: number;
36+
numSpotShadows: number;
37+
};
38+
39+
get( light: any ): any;
40+
setup( lights: any, shadows: any, camera: any ): void;
741
}
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
export class WebGLObjects {
22

3-
constructor( gl: WebGLRenderingContext, properties: any, info: any );
3+
constructor(
4+
gl: WebGLRenderingContext,
5+
geometries: any,
6+
attributes: any,
7+
info: any
8+
);
49

5-
getAttributeBuffer( attribute: any ): any;
6-
getWireframeAttribute( geometry: any ): any;
7-
update( object: any ): void;
10+
update( object: any ): any;
11+
dispose(): void;
812

913
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export class WebGLShader {
22

3-
constructor( gl: any, type: string, string: string );
3+
constructor( gl: WebGLRenderingContext, type: string, string: string );
44

55
}
Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,33 @@
1+
import { WebGLExtensions } from './WebGLExtensions.js';
2+
import { WebGLState } from './WebGLState.js';
3+
import { WebGLProperties } from './WebGLProperties.js';
4+
import { WebGLCapabilities } from './WebGLCapabilities.js';
5+
import { WebGLUtils } from './WebGLUtils.js';
6+
import { WebGLInfo } from './WebGLInfo.js';
7+
18
export class WebGLTextures {
29

310
constructor(
4-
gl: any,
5-
extensions: any,
6-
state: any,
7-
properties: any,
8-
capabilities: any,
9-
paramThreeToGL: Function,
10-
info: any
11+
gl: WebGLRenderingContext,
12+
extensions: WebGLExtensions,
13+
state: WebGLState,
14+
properties: WebGLProperties,
15+
capabilities: WebGLCapabilities,
16+
utils: WebGLUtils,
17+
info: WebGLInfo
1118
);
1219

20+
allocateTextureUnit(): void;
21+
resetTextureUnits(): void;
1322
setTexture2D( texture: any, slot: number ): void;
23+
setTexture2DArray( texture: any, slot: number ): void;
24+
setTexture3D( texture: any, slot: number ): void;
1425
setTextureCube( texture: any, slot: number ): void;
1526
setTextureCubeDynamic( texture: any, slot: number ): void;
1627
setupRenderTarget( renderTarget: any ): void;
1728
updateRenderTargetMipmap( renderTarget: any ): void;
29+
updateMultisampleRenderTarget( renderTarget: any ): void;
30+
safeSetTexture2D( texture: any, slot: number ): void;
31+
safeSetTextureCube( texture: any, slot: number ): void;
1832

1933
}

src/renderers/webgl/WebGLUniforms.d.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@ import { WebGLTextures } from './WebGLTextures';
33

44
export class WebGLUniforms {
55

6-
constructor( gl: any, program: WebGLProgram );
6+
constructor( gl: WebGLRenderingContext, program: WebGLProgram );
77

8-
setValue( gl: any, name: string, value: any, textures: WebGLTextures ): void;
9-
setOptional( gl: any, object: any, name: string ): void;
8+
setValue( gl: WebGLRenderingContext, name: string, value: any, textures: WebGLTextures ): void;
9+
setOptional( gl: WebGLRenderingContext, object: any, name: string ): void;
1010

11-
static upload( gl: any, seq: any, values: any[], textures: WebGLTextures ): void;
11+
static upload( gl: WebGLRenderingContext, seq: any, values: any[], textures: WebGLTextures ): void;
1212
static seqWithValue( seq: any, values: any[] ): any[];
13-
static splitDynamic( seq: any, values: any[] ): any[];
14-
static evalDynamic( seq: any, values: any[], object: any, camera: any ): any[];
1513

1614
}

0 commit comments

Comments
 (0)