From a59a9d256bfe47888ab553befd6ae28d879ad28b Mon Sep 17 00:00:00 2001 From: Stig Lindqvist Date: Sat, 14 Nov 2020 00:27:29 +1300 Subject: [PATCH] Fix depth write failure on shadow cubemap generation Ensure the depth map is cleared between generating the different faces of the cubemap. If this isnt done, only the first face will have accurate values. --- example/point-light-shadow.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/example/point-light-shadow.js b/example/point-light-shadow.js index 56ed4471..6338adca 100644 --- a/example/point-light-shadow.js +++ b/example/point-light-shadow.js @@ -289,9 +289,10 @@ regl.frame(({ tick }) => { globalScope(() => { drawDepth(6, () => { + regl.clear({ depth: 1 }) drawMeshes() }) - + regl.clear({ color: [0, 0, 0, 1] }) drawNormal(() => { drawMeshes() })