mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 07:14:55 +08:00
[ts] Updated build to include new tint black shader.
This commit is contained in:
parent
8506e16f2d
commit
936a7b048f
4
spine-ts/build/spine-all.d.ts
vendored
4
spine-ts/build/spine-all.d.ts
vendored
@ -1517,7 +1517,9 @@ declare module spine.webgl {
|
||||
static SAMPLER: string;
|
||||
private context;
|
||||
private vs;
|
||||
private vsSource;
|
||||
private fs;
|
||||
private fsSource;
|
||||
private program;
|
||||
private tmp2x2;
|
||||
private tmp3x3;
|
||||
@ -1525,6 +1527,8 @@ declare module spine.webgl {
|
||||
getProgram(): WebGLProgram;
|
||||
getVertexShader(): string;
|
||||
getFragmentShader(): string;
|
||||
getVertexShaderSource(): string;
|
||||
getFragmentSource(): string;
|
||||
constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, vertexShader: string, fragmentShader: string);
|
||||
private compile();
|
||||
private compileShader(type, source);
|
||||
|
||||
@ -8136,6 +8136,8 @@ var spine;
|
||||
this.tmp2x2 = new Float32Array(2 * 2);
|
||||
this.tmp3x3 = new Float32Array(3 * 3);
|
||||
this.tmp4x4 = new Float32Array(4 * 4);
|
||||
this.vsSource = vertexShader;
|
||||
this.fsSource = fragmentShader;
|
||||
this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);
|
||||
this.context.addRestorable(this);
|
||||
this.compile();
|
||||
@ -8143,6 +8145,8 @@ var spine;
|
||||
Shader.prototype.getProgram = function () { return this.program; };
|
||||
Shader.prototype.getVertexShader = function () { return this.vertexShader; };
|
||||
Shader.prototype.getFragmentShader = function () { return this.fragmentShader; };
|
||||
Shader.prototype.getVertexShaderSource = function () { return this.vsSource; };
|
||||
Shader.prototype.getFragmentSource = function () { return this.fsSource; };
|
||||
Shader.prototype.compile = function () {
|
||||
var gl = this.context.gl;
|
||||
try {
|
||||
@ -8258,7 +8262,7 @@ var spine;
|
||||
};
|
||||
Shader.newTwoColoredTextured = function (context) {
|
||||
var vs = "\n\t\t\t\tattribute vec4 " + Shader.POSITION + ";\n\t\t\t\tattribute vec4 " + Shader.COLOR + ";\n\t\t\t\tattribute vec4 " + Shader.COLOR2 + ";\n\t\t\t\tattribute vec2 " + Shader.TEXCOORDS + ";\n\t\t\t\tuniform mat4 " + Shader.MVP_MATRIX + ";\n\t\t\t\tvarying vec4 v_light;\n\t\t\t\tvarying vec4 v_dark;\n\t\t\t\tvarying vec2 v_texCoords;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tv_light = " + Shader.COLOR + ";\n\t\t\t\t\tv_dark = " + Shader.COLOR2 + ";\n\t\t\t\t\tv_texCoords = " + Shader.TEXCOORDS + ";\n\t\t\t\t\tgl_Position = " + Shader.MVP_MATRIX + " * " + Shader.POSITION + ";\n\t\t\t\t}\n\t\t\t";
|
||||
var fs = "\n\t\t\t\t#ifdef GL_ES\n\t\t\t\t\t#define LOWP lowp\n\t\t\t\t\tprecision mediump float;\n\t\t\t\t#else\n\t\t\t\t\t#define LOWP\n\t\t\t\t#endif\n\t\t\t\tvarying LOWP vec4 v_light;\n\t\t\t\tvarying LOWP vec4 v_dark;\n\t\t\t\tvarying vec2 v_texCoords;\n\t\t\t\tuniform sampler2D u_texture;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tvec4 texColor = texture2D(u_texture, v_texCoords);\n\t\t\t\t\tfloat alpha = texColor.a * v_light.a;\n\t\t\t\t\tgl_FragColor.a = alpha;\n\t\t\t\t\tgl_FragColor.rgb = (1.0 - texColor.rgb) * v_dark.rgb * alpha + texColor.rgb * v_light.rgb;\n\t\t\t\t}\n\t\t\t";
|
||||
var fs = "\n\t\t\t\t#ifdef GL_ES\n\t\t\t\t\t#define LOWP lowp\n\t\t\t\t\tprecision mediump float;\n\t\t\t\t#else\n\t\t\t\t\t#define LOWP\n\t\t\t\t#endif\n\t\t\t\tvarying LOWP vec4 v_light;\n\t\t\t\tvarying LOWP vec4 v_dark;\n\t\t\t\tvarying vec2 v_texCoords;\n\t\t\t\tuniform sampler2D u_texture;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tvec4 texColor = texture2D(u_texture, v_texCoords);\n\t\t\t\t\tgl_FragColor.a = texColor.a * v_light.a;\n\t\t\t\t\tgl_FragColor.rgb = ((texColor.a - 1.0) * v_dark.a + 1.0 - texColor.rgb) * v_dark.rgb + texColor.rgb * v_light.rgb;\n\t\t\t\t}\n\t\t\t";
|
||||
return new Shader(context, vs, fs);
|
||||
};
|
||||
Shader.newColored = function (context) {
|
||||
@ -8893,9 +8897,18 @@ var spine;
|
||||
}
|
||||
var darkColor = this.tempColor2;
|
||||
if (slot.darkColor == null)
|
||||
darkColor.set(0, 0, 0, 1);
|
||||
else
|
||||
darkColor.setFromColor(slot.darkColor);
|
||||
darkColor.set(0, 0, 0, 1.0);
|
||||
else {
|
||||
if (premultipliedAlpha) {
|
||||
darkColor.r = slot.darkColor.r * finalColor.a;
|
||||
darkColor.g = slot.darkColor.g * finalColor.a;
|
||||
darkColor.b = slot.darkColor.b * finalColor.a;
|
||||
}
|
||||
else {
|
||||
darkColor.setFromColor(slot.darkColor);
|
||||
}
|
||||
darkColor.a = premultipliedAlpha ? 1.0 : 0.0;
|
||||
}
|
||||
var slotBlendMode = slot.data.blendMode;
|
||||
if (slotBlendMode != blendMode) {
|
||||
blendMode = slotBlendMode;
|
||||
|
||||
File diff suppressed because one or more lines are too long
3076
spine-ts/build/spine-webgl.d.ts
vendored
3076
spine-ts/build/spine-webgl.d.ts
vendored
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
4
spine-ts/build/spine-widget.d.ts
vendored
4
spine-ts/build/spine-widget.d.ts
vendored
@ -1486,7 +1486,9 @@ declare module spine.webgl {
|
||||
static SAMPLER: string;
|
||||
private context;
|
||||
private vs;
|
||||
private vsSource;
|
||||
private fs;
|
||||
private fsSource;
|
||||
private program;
|
||||
private tmp2x2;
|
||||
private tmp3x3;
|
||||
@ -1494,6 +1496,8 @@ declare module spine.webgl {
|
||||
getProgram(): WebGLProgram;
|
||||
getVertexShader(): string;
|
||||
getFragmentShader(): string;
|
||||
getVertexShaderSource(): string;
|
||||
getFragmentSource(): string;
|
||||
constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, vertexShader: string, fragmentShader: string);
|
||||
private compile();
|
||||
private compileShader(type, source);
|
||||
|
||||
@ -7881,6 +7881,8 @@ var spine;
|
||||
this.tmp2x2 = new Float32Array(2 * 2);
|
||||
this.tmp3x3 = new Float32Array(3 * 3);
|
||||
this.tmp4x4 = new Float32Array(4 * 4);
|
||||
this.vsSource = vertexShader;
|
||||
this.fsSource = fragmentShader;
|
||||
this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);
|
||||
this.context.addRestorable(this);
|
||||
this.compile();
|
||||
@ -7888,6 +7890,8 @@ var spine;
|
||||
Shader.prototype.getProgram = function () { return this.program; };
|
||||
Shader.prototype.getVertexShader = function () { return this.vertexShader; };
|
||||
Shader.prototype.getFragmentShader = function () { return this.fragmentShader; };
|
||||
Shader.prototype.getVertexShaderSource = function () { return this.vsSource; };
|
||||
Shader.prototype.getFragmentSource = function () { return this.fsSource; };
|
||||
Shader.prototype.compile = function () {
|
||||
var gl = this.context.gl;
|
||||
try {
|
||||
@ -8003,7 +8007,7 @@ var spine;
|
||||
};
|
||||
Shader.newTwoColoredTextured = function (context) {
|
||||
var vs = "\n\t\t\t\tattribute vec4 " + Shader.POSITION + ";\n\t\t\t\tattribute vec4 " + Shader.COLOR + ";\n\t\t\t\tattribute vec4 " + Shader.COLOR2 + ";\n\t\t\t\tattribute vec2 " + Shader.TEXCOORDS + ";\n\t\t\t\tuniform mat4 " + Shader.MVP_MATRIX + ";\n\t\t\t\tvarying vec4 v_light;\n\t\t\t\tvarying vec4 v_dark;\n\t\t\t\tvarying vec2 v_texCoords;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tv_light = " + Shader.COLOR + ";\n\t\t\t\t\tv_dark = " + Shader.COLOR2 + ";\n\t\t\t\t\tv_texCoords = " + Shader.TEXCOORDS + ";\n\t\t\t\t\tgl_Position = " + Shader.MVP_MATRIX + " * " + Shader.POSITION + ";\n\t\t\t\t}\n\t\t\t";
|
||||
var fs = "\n\t\t\t\t#ifdef GL_ES\n\t\t\t\t\t#define LOWP lowp\n\t\t\t\t\tprecision mediump float;\n\t\t\t\t#else\n\t\t\t\t\t#define LOWP\n\t\t\t\t#endif\n\t\t\t\tvarying LOWP vec4 v_light;\n\t\t\t\tvarying LOWP vec4 v_dark;\n\t\t\t\tvarying vec2 v_texCoords;\n\t\t\t\tuniform sampler2D u_texture;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tvec4 texColor = texture2D(u_texture, v_texCoords);\n\t\t\t\t\tfloat alpha = texColor.a * v_light.a;\n\t\t\t\t\tgl_FragColor.a = alpha;\n\t\t\t\t\tgl_FragColor.rgb = (1.0 - texColor.rgb) * v_dark.rgb * alpha + texColor.rgb * v_light.rgb;\n\t\t\t\t}\n\t\t\t";
|
||||
var fs = "\n\t\t\t\t#ifdef GL_ES\n\t\t\t\t\t#define LOWP lowp\n\t\t\t\t\tprecision mediump float;\n\t\t\t\t#else\n\t\t\t\t\t#define LOWP\n\t\t\t\t#endif\n\t\t\t\tvarying LOWP vec4 v_light;\n\t\t\t\tvarying LOWP vec4 v_dark;\n\t\t\t\tvarying vec2 v_texCoords;\n\t\t\t\tuniform sampler2D u_texture;\n\n\t\t\t\tvoid main () {\n\t\t\t\t\tvec4 texColor = texture2D(u_texture, v_texCoords);\n\t\t\t\t\tgl_FragColor.a = texColor.a * v_light.a;\n\t\t\t\t\tgl_FragColor.rgb = ((texColor.a - 1.0) * v_dark.a + 1.0 - texColor.rgb) * v_dark.rgb + texColor.rgb * v_light.rgb;\n\t\t\t\t}\n\t\t\t";
|
||||
return new Shader(context, vs, fs);
|
||||
};
|
||||
Shader.newColored = function (context) {
|
||||
@ -8638,9 +8642,18 @@ var spine;
|
||||
}
|
||||
var darkColor = this.tempColor2;
|
||||
if (slot.darkColor == null)
|
||||
darkColor.set(0, 0, 0, 1);
|
||||
else
|
||||
darkColor.setFromColor(slot.darkColor);
|
||||
darkColor.set(0, 0, 0, 1.0);
|
||||
else {
|
||||
if (premultipliedAlpha) {
|
||||
darkColor.r = slot.darkColor.r * finalColor.a;
|
||||
darkColor.g = slot.darkColor.g * finalColor.a;
|
||||
darkColor.b = slot.darkColor.b * finalColor.a;
|
||||
}
|
||||
else {
|
||||
darkColor.setFromColor(slot.darkColor);
|
||||
}
|
||||
darkColor.a = premultipliedAlpha ? 1.0 : 0.0;
|
||||
}
|
||||
var slotBlendMode = slot.data.blendMode;
|
||||
if (slotBlendMode != blendMode) {
|
||||
blendMode = slotBlendMode;
|
||||
|
||||
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user