rapid-render 0.1.1 → 0.1.3
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/README.md +71 -81
- package/dist/depth.d.ts +8 -0
- package/dist/index.d.ts +4 -3
- package/dist/interface.d.ts +90 -29
- package/dist/line.d.ts +8 -1
- package/dist/log.d.ts +2 -0
- package/dist/math.d.ts +218 -44
- package/dist/particle.d.ts +14 -0
- package/dist/rapid.global.js +1 -1
- package/dist/rapid.js +2453 -1
- package/dist/rapid.umd.cjs +1 -1
- package/dist/regions/attributes.d.ts +44 -0
- package/dist/regions/graphic_region.d.ts +7 -20
- package/dist/regions/region.d.ts +13 -5
- package/dist/regions/sprite_region.d.ts +3 -26
- package/dist/render.d.ts +101 -37
- package/dist/texture.d.ts +30 -2
- package/dist/tilemap.d.ts +97 -0
- package/dist/utils.d.ts +1 -0
- package/dist/webgl/glshader.d.ts +14 -4
- package/dist/webgl/uniform.d.ts +13 -0
- package/package.json +1 -1
package/dist/webgl/glshader.d.ts
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import { IAttribute,
|
|
1
|
+
import { IAttribute, ShaderType } from "../interface";
|
|
2
2
|
import Rapid from "../render";
|
|
3
|
+
import { Uniform } from "./uniform";
|
|
3
4
|
declare class GLShader {
|
|
4
5
|
attributeLoc: Record<string, number>;
|
|
5
6
|
uniformLoc: Record<string, WebGLUniformLocation>;
|
|
6
7
|
program: WebGLProgram;
|
|
8
|
+
private attributes;
|
|
7
9
|
private gl;
|
|
8
|
-
|
|
10
|
+
usedTexture: number;
|
|
11
|
+
constructor(rapid: Rapid, vs: string, fs: string, attributes?: IAttribute[], usedTexture?: number);
|
|
9
12
|
/**
|
|
10
13
|
* Set the uniform of this shader
|
|
11
14
|
* @param uniforms
|
|
12
15
|
* @param usedTextureUnit How many texture units have been used
|
|
13
16
|
*/
|
|
14
|
-
setUniforms(
|
|
17
|
+
setUniforms(uniform: Uniform, usedTextureUnit: number): number;
|
|
15
18
|
private getUniform;
|
|
16
19
|
/**
|
|
17
20
|
* use this shader
|
|
@@ -19,9 +22,16 @@ declare class GLShader {
|
|
|
19
22
|
use(): void;
|
|
20
23
|
private parseShader;
|
|
21
24
|
/**
|
|
22
|
-
* Set vertex
|
|
25
|
+
* Set vertex attribute in glsl shader
|
|
23
26
|
* @param element
|
|
24
27
|
*/
|
|
25
28
|
setAttribute(element: IAttribute): void;
|
|
29
|
+
/**
|
|
30
|
+
* Set vertex attributes in glsl shader
|
|
31
|
+
* @param elements
|
|
32
|
+
*/
|
|
33
|
+
setAttributes(elements: IAttribute[]): void;
|
|
34
|
+
updateAttributes(): void;
|
|
35
|
+
static createCostumShader(rapid: Rapid, vs: string, fs: string, type: ShaderType, usedTexture?: number): GLShader;
|
|
26
36
|
}
|
|
27
37
|
export default GLShader;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { UniformType, WebGLContext } from '../interface';
|
|
2
|
+
export declare class Uniform {
|
|
3
|
+
private data;
|
|
4
|
+
isDirty: boolean;
|
|
5
|
+
constructor(data: UniformType);
|
|
6
|
+
setUniform(key: string, data: UniformType[string]): void;
|
|
7
|
+
/**
|
|
8
|
+
* @ignore
|
|
9
|
+
*/
|
|
10
|
+
clearDirty(): void;
|
|
11
|
+
getUnifromNames(): string[];
|
|
12
|
+
bind(gl: WebGLContext, uniformName: string, loc: WebGLUniformLocation, usedTextureUnit: number): number;
|
|
13
|
+
}
|