fix: fix Y - UV coordinate issue flipping the preview in chroma key.
All checks were successful
Deploy to Production / test (push) Successful in 38s
All checks were successful
Deploy to Production / test (push) Successful in 38s
This commit is contained in:
@@ -56,7 +56,6 @@ attribute vec2 aPos;
|
|||||||
varying vec2 vUV;
|
varying vec2 vUV;
|
||||||
void main() {
|
void main() {
|
||||||
vUV = aPos * 0.5 + 0.5;
|
vUV = aPos * 0.5 + 0.5;
|
||||||
vUV.y = 1.0 - vUV.y;
|
|
||||||
gl_Position = vec4(aPos, 0.0, 1.0);
|
gl_Position = vec4(aPos, 0.0, 1.0);
|
||||||
}`;
|
}`;
|
||||||
|
|
||||||
@@ -464,7 +463,9 @@ export function BackgroundRemoval() {
|
|||||||
gl.bindTexture(gl.TEXTURE_2D, srcTex);
|
gl.bindTexture(gl.TEXTURE_2D, srcTex);
|
||||||
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
|
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
|
||||||
gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);
|
gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);
|
||||||
|
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);
|
||||||
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, img);
|
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, img);
|
||||||
|
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
|
||||||
|
|
||||||
gl.bindTexture(gl.TEXTURE_2D, fboTex);
|
gl.bindTexture(gl.TEXTURE_2D, fboTex);
|
||||||
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, img.naturalWidth, img.naturalHeight, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
|
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, img.naturalWidth, img.naturalHeight, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
|
||||||
|
|||||||
Reference in New Issue
Block a user