diff --git a/src/filters/colormatrix/ColorMatrixFilter.js b/src/filters/colormatrix/ColorMatrixFilter.js index 5ef6af8..e6fde6e 100644 --- a/src/filters/colormatrix/ColorMatrixFilter.js +++ b/src/filters/colormatrix/ColorMatrixFilter.js @@ -37,7 +37,7 @@ 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]; - this.interpolation = 1; + this.alpha = 1; } /** @@ -579,7 +579,7 @@ } /** - * The interpolation value to use when mixing the original and resultant colors. + * The opacity value to use when mixing the original and resultant colors. * * When the value is 0, the original color is used without modification. * When the value is 1, the result color is used. @@ -588,14 +588,14 @@ * @member {number} * @default 1 */ - get interpolation() + get alpha() { - return this.uniforms.uInterpolation; + return this.uniforms.uAlpha; } - set interpolation(value) // eslint-disable-line require-jsdoc + set alpha(value) // eslint-disable-line require-jsdoc { - this.uniforms.uInterpolation = value; + this.uniforms.uAlpha = value; } } diff --git a/src/filters/colormatrix/ColorMatrixFilter.js b/src/filters/colormatrix/ColorMatrixFilter.js index 5ef6af8..e6fde6e 100644 --- a/src/filters/colormatrix/ColorMatrixFilter.js +++ b/src/filters/colormatrix/ColorMatrixFilter.js @@ -37,7 +37,7 @@ 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]; - this.interpolation = 1; + this.alpha = 1; } /** @@ -579,7 +579,7 @@ } /** - * The interpolation value to use when mixing the original and resultant colors. + * The opacity value to use when mixing the original and resultant colors. * * When the value is 0, the original color is used without modification. * When the value is 1, the result color is used. @@ -588,14 +588,14 @@ * @member {number} * @default 1 */ - get interpolation() + get alpha() { - return this.uniforms.uInterpolation; + return this.uniforms.uAlpha; } - set interpolation(value) // eslint-disable-line require-jsdoc + set alpha(value) // eslint-disable-line require-jsdoc { - this.uniforms.uInterpolation = value; + this.uniforms.uAlpha = value; } } diff --git a/src/filters/colormatrix/colorMatrix.frag b/src/filters/colormatrix/colorMatrix.frag index 9729c5a..afca6a9 100644 --- a/src/filters/colormatrix/colorMatrix.frag +++ b/src/filters/colormatrix/colorMatrix.frag @@ -1,13 +1,13 @@ varying vec2 vTextureCoord; uniform sampler2D uSampler; uniform float m[20]; -uniform float uInterpolation; +uniform float uAlpha; void main(void) { vec4 c = texture2D(uSampler, vTextureCoord); - if (uInterpolation == 0.0) { + if (uAlpha == 0.0) { gl_FragColor = c; return; } @@ -43,7 +43,7 @@ result.a += (m[18] * c.a); result.a += m[19]; - vec3 rgb = mix(c.rgb, result.rgb, uInterpolation); + vec3 rgb = mix(c.rgb, result.rgb, uAlpha); // Premultiply alpha again. rgb *= result.a;