@blakron/core 0.5.3 → 0.5.4
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.
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* For WebGL1 (GLSL ES 1.00) shaders see ../webgl/ShaderLib.ts
|
|
4
4
|
*/
|
|
5
5
|
export declare const ShaderLib2: {
|
|
6
|
-
readonly default_vert: "#version 300 es\nlayout(std140
|
|
7
|
-
readonly multi_vert: "#version 300 es\nlayout(std140
|
|
6
|
+
readonly default_vert: "#version 300 es\nlayout(std140) uniform FrameUniforms {\n mat4 projectionMatrix;\n vec2 projectionVector;\n vec2 uTextureSize;\n float uTime;\n};\n\nin vec2 aVertexPosition;\nin vec2 aTextureCoord;\nin vec4 aColor;\nout vec2 vTextureCoord;\nout vec4 vColor;\nconst vec2 center = vec2(-1.0, 1.0);\nvoid main(void) {\n gl_Position = vec4((aVertexPosition / projectionVector) + center, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vColor = aColor;\n}";
|
|
7
|
+
readonly multi_vert: "#version 300 es\nlayout(std140) uniform FrameUniforms {\n mat4 projectionMatrix;\n vec2 projectionVector;\n vec2 uTextureSize;\n float uTime;\n};\nin vec2 aVertexPosition;\nin vec2 aTextureCoord;\nin vec4 aColor;\nin float aTextureId;\nout vec2 vTextureCoord;\nout vec4 vColor;\nout float vTextureId;\nconst vec2 center = vec2(-1.0, 1.0);\nvoid main(void) {\n gl_Position = vec4((aVertexPosition / projectionVector) + center, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vColor = aColor;\n vTextureId = aTextureId;\n}";
|
|
8
8
|
readonly multi_frag: "#version 300 es\nprecision lowp float;\nin vec2 vTextureCoord;\nin vec4 vColor;\nin float vTextureId;\nuniform sampler2D uSamplers[8];\nout vec4 fragColor;\nvoid main(void) {\n vec4 color;\n int id = int(vTextureId + 0.5);\n if (id == 0) color = texture(uSamplers[0], vTextureCoord);\n else if (id == 1) color = texture(uSamplers[1], vTextureCoord);\n else if (id == 2) color = texture(uSamplers[2], vTextureCoord);\n else if (id == 3) color = texture(uSamplers[3], vTextureCoord);\n else if (id == 4) color = texture(uSamplers[4], vTextureCoord);\n else if (id == 5) color = texture(uSamplers[5], vTextureCoord);\n else if (id == 6) color = texture(uSamplers[6], vTextureCoord);\n else color = texture(uSamplers[7], vTextureCoord);\n fragColor = color * vColor;\n}";
|
|
9
9
|
readonly texture_frag: "#version 300 es\nprecision lowp float;\nin vec2 vTextureCoord;\nin vec4 vColor;\nuniform sampler2D uSampler;\nout vec4 fragColor;\nvoid main(void) {\n fragColor = texture(uSampler, vTextureCoord) * vColor;\n}";
|
|
10
10
|
readonly primitive_frag: "#version 300 es\nprecision lowp float;\nin vec2 vTextureCoord;\nin vec4 vColor;\nout vec4 fragColor;\nvoid main(void) {\n fragColor = vColor;\n}";
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export const ShaderLib2 = {
|
|
6
6
|
default_vert: /* glsl */ `#version 300 es
|
|
7
|
-
layout(std140
|
|
7
|
+
layout(std140) uniform FrameUniforms {
|
|
8
8
|
mat4 projectionMatrix;
|
|
9
9
|
vec2 projectionVector;
|
|
10
10
|
vec2 uTextureSize;
|
|
@@ -24,7 +24,7 @@ void main(void) {
|
|
|
24
24
|
}`,
|
|
25
25
|
// Multi-texture vertex shader: carries textureId as a float attribute.
|
|
26
26
|
multi_vert: /* glsl */ `#version 300 es
|
|
27
|
-
layout(std140
|
|
27
|
+
layout(std140) uniform FrameUniforms {
|
|
28
28
|
mat4 projectionMatrix;
|
|
29
29
|
vec2 projectionVector;
|
|
30
30
|
vec2 uTextureSize;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blakron/core",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"description": "Modern rewrite of the Egret game engine — WebGL multi-texture batching, instruction-driven render pipeline, strict TypeScript, Egret-compatible API",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "MIT",
|