From 52e8bac17b60f64f2365b821983ae8b8cd77dbb4 Mon Sep 17 00:00:00 2001 From: Syed Idris Shah Date: Thu, 25 Jan 2024 15:17:38 -0500 Subject: [PATCH] Add missing glClear call to layer samples --- layers-samples/cube-layer.html | 1 + layers-samples/cyld-layer.html | 1 + layers-samples/eqrt-layer.html | 1 + layers-samples/quad-ab-test.html | 1 + layers-samples/quad-layer.html | 1 + layers-samples/quad-select.html | 1 + 6 files changed, 6 insertions(+) diff --git a/layers-samples/cube-layer.html b/layers-samples/cube-layer.html index e35e7988..43735bbf 100644 --- a/layers-samples/cube-layer.html +++ b/layers-samples/cube-layer.html @@ -298,6 +298,7 @@ glLayer.framebuffer = xrFramebuffer; viewport = glLayer.viewport; gl.bindFramebuffer(gl.FRAMEBUFFER, xrFramebuffer); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, glLayer.colorTexture, 0); gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.TEXTURE_2D, glLayer.depthStencilTexture, 0); views.push(new WebXRView(view, glLayer, viewport)); diff --git a/layers-samples/cyld-layer.html b/layers-samples/cyld-layer.html index 7de3e19a..61ea5f11 100644 --- a/layers-samples/cyld-layer.html +++ b/layers-samples/cyld-layer.html @@ -235,6 +235,7 @@ glLayer.framebuffer = xrFramebuffer; viewport = glLayer.viewport; gl.bindFramebuffer(gl.FRAMEBUFFER, xrFramebuffer); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, glLayer.colorTexture, 0); gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.TEXTURE_2D, glLayer.depthStencilTexture, 0); views.push(new WebXRView(view, glLayer, viewport)); diff --git a/layers-samples/eqrt-layer.html b/layers-samples/eqrt-layer.html index 3237538c..3d76c001 100644 --- a/layers-samples/eqrt-layer.html +++ b/layers-samples/eqrt-layer.html @@ -232,6 +232,7 @@ glLayer.framebuffer = xrFramebuffer; viewport = glLayer.viewport; gl.bindFramebuffer(gl.FRAMEBUFFER, xrFramebuffer); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, glLayer.colorTexture, 0); gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.TEXTURE_2D, glLayer.depthStencilTexture, 0); views.push(new WebXRView(view, glLayer, viewport)); diff --git a/layers-samples/quad-ab-test.html b/layers-samples/quad-ab-test.html index c515ca4c..880000bf 100644 --- a/layers-samples/quad-ab-test.html +++ b/layers-samples/quad-ab-test.html @@ -250,6 +250,7 @@ glLayer.framebuffer = xrFramebuffer; viewport = glLayer.viewport; gl.bindFramebuffer(gl.FRAMEBUFFER, xrFramebuffer); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, glLayer.colorTexture, 0); gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.TEXTURE_2D, glLayer.depthStencilTexture, 0); views.push(new WebXRView(view, glLayer, viewport)); diff --git a/layers-samples/quad-layer.html b/layers-samples/quad-layer.html index 35ee9280..f1f3a201 100644 --- a/layers-samples/quad-layer.html +++ b/layers-samples/quad-layer.html @@ -225,6 +225,7 @@ glLayer.framebuffer = xrFramebuffer; viewport = glLayer.viewport; gl.bindFramebuffer(gl.FRAMEBUFFER, xrFramebuffer); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, glLayer.colorTexture, 0); gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.TEXTURE_2D, glLayer.depthStencilTexture, 0); views.push(new WebXRView(view, glLayer, viewport)); diff --git a/layers-samples/quad-select.html b/layers-samples/quad-select.html index c0afba09..60019516 100644 --- a/layers-samples/quad-select.html +++ b/layers-samples/quad-select.html @@ -286,6 +286,7 @@ glLayer.framebuffer = xrFramebuffer; viewport = glLayer.viewport; gl.bindFramebuffer(gl.FRAMEBUFFER, xrFramebuffer); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, glLayer.colorTexture, 0); gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.TEXTURE_2D, glLayer.depthStencilTexture, 0); views.push(new WebXRView(view, glLayer, viewport));