Skip to content

Commit 2dd9777

Browse files
committed
No need to recreate webcam texture
1 parent 8558487 commit 2dd9777

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

Packages/webxr-interactions/Runtime/Plugins/WebGL/FixWebCamWebGL.jslib

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,9 @@ var LibraryFixWebCamWebGL = {
6464
return;
6565
}
6666
webcamBufferToTextureTable[buffer] = webcamLatestTextureId;
67-
GLctx.deleteTexture(GL.textures[webcamBufferToTextureTable[buffer]]);
68-
var t = GLctx.createTexture();
69-
t.name = webcamBufferToTextureTable[buffer];
70-
GL.textures[webcamBufferToTextureTable[buffer]] = t;
71-
GLctx.bindTexture(GLctx.TEXTURE_2D, t);
72-
GLctx.texParameteri(GLctx.TEXTURE_2D, GLctx.TEXTURE_WRAP_S, GLctx.CLAMP_TO_EDGE);
73-
GLctx.texParameteri(GLctx.TEXTURE_2D, GLctx.TEXTURE_WRAP_T, GLctx.CLAMP_TO_EDGE);
74-
GLctx.texParameteri(GLctx.TEXTURE_2D, GLctx.TEXTURE_MIN_FILTER, GLctx.LINEAR);
7567
webcamLatestTextureId = 0
76-
} else {
77-
GLctx.bindTexture(GLctx.TEXTURE_2D, GL.textures[webcamBufferToTextureTable[buffer]])
7868
}
69+
GLctx.bindTexture(GLctx.TEXTURE_2D, GL.textures[webcamBufferToTextureTable[buffer]]);
7970
GLctx.pixelStorei(GLctx.UNPACK_FLIP_Y_WEBGL, true);
8071
GLctx.texImage2D(GLctx.TEXTURE_2D, 0, GLctx.RGBA, GLctx.RGBA, GLctx.UNSIGNED_BYTE, videoElement);
8172
GLctx.pixelStorei(GLctx.UNPACK_FLIP_Y_WEBGL, false);

0 commit comments

Comments
 (0)