From 316d0fedc9da9f4fcbdbcef8fd46334a72876982 Mon Sep 17 00:00:00 2001 From: "A.Olokhtonov" Date: Tue, 14 Nov 2023 02:16:12 +0300 Subject: [PATCH] Use correct rendering order.. --- client/webgl_draw.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/webgl_draw.js b/client/webgl_draw.js index 641fdbd..defeadd 100644 --- a/client/webgl_draw.js +++ b/client/webgl_draw.js @@ -73,6 +73,8 @@ function draw(state, context) { if (static_points > 0) { // DEPTH PREPASS + index_buffer.reverse(); + if (context.do_prepass) { gl.drawBuffers([gl.NONE]); @@ -94,11 +96,9 @@ function draw(state, context) { gl.vertexAttribIPointer(locations['a_stroke_id'], 1, gl.INT, config.bytes_per_point, 4 * 3 + 4 * 4 + 4); gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, index_buffer, gl.DYNAMIC_DRAW); - gl.drawElements(gl.TRIANGLES, index_count, gl.UNSIGNED_INT, 0); } - index_buffer.reverse(); // MAIN PASS gl.drawBuffers([gl.BACK]);