From da755e4ec23961bd8314ef60600c2ede427494aa Mon Sep 17 00:00:00 2001 From: "A.Olokhtonov" Date: Sun, 24 Nov 2024 19:33:32 +0300 Subject: [PATCH] Fix first stroke not drawing because it has Z=0 --- README.txt | 2 +- client/webgl_shaders.js | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/README.txt b/README.txt index 6191c85..4a5133e 100644 --- a/README.txt +++ b/README.txt @@ -67,7 +67,7 @@ Release: - Set up VAOs - We are calling "geometry_prepare_stroke" twice for some reason - Replace "geometry_add_dummy_stroke" with something not [so] cursed - - Automatically extract locations from shaders (see nitka project for code examples) + + Automatically extract locations from shaders (see nitka project for code examples) - Presentation / "marketing" - Title (InfiNotes? MegaDesk?) - Icon diff --git a/client/webgl_shaders.js b/client/webgl_shaders.js index a2c65bb..123d768 100644 --- a/client/webgl_shaders.js +++ b/client/webgl_shaders.js @@ -68,7 +68,7 @@ const sdf_vs_src = `#version 300 es screen02 += vec2(100.0); // shift offscreen } - gl_Position = vec4(screen02 - 1.0, (float(stroke_index) / float(u_stroke_count)) * 2.0 - 1.0, 1.0); + gl_Position = vec4(screen02 - 1.0, (float(stroke_index + 1) / float(u_stroke_count)) * 2.0 - 1.0, 1.0); } `; @@ -323,10 +323,8 @@ function init_webgl(state, context) { gl.enable(gl.BLEND); gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA); - /* gl.enable(gl.DEPTH_TEST); gl.depthFunc(gl.NOTEQUAL); - */ context.gpu_timer_ext = gl.getExtension('EXT_disjoint_timer_query_webgl2'); if (context.gpu_timer_ext === null) {