From cca3b4cd5d3b3bf2655116ff89edb4f968b1a196 Mon Sep 17 00:00:00 2001 From: "A.Olokhtonov" Date: Tue, 5 Dec 2023 01:09:57 +0300 Subject: [PATCH] Fix the depth prepass artefacts --- client/client_recv.js | 2 +- client/webgl_shaders.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/client_recv.js b/client/client_recv.js index 2bf76b1..6df8d55 100644 --- a/client/client_recv.js +++ b/client/client_recv.js @@ -178,7 +178,7 @@ function handle_event(state, context, event, options = {}) { event.index = state.events.length; event.starting_index = state.starting_index; - if (event.points.length > 0) { + if (event.points.length > 1) { state.starting_index += (event.points.length - 1) * 4; } diff --git a/client/webgl_shaders.js b/client/webgl_shaders.js index 6d8b696..8790c39 100644 --- a/client/webgl_shaders.js +++ b/client/webgl_shaders.js @@ -125,7 +125,7 @@ const sdf_vs_src = `#version 300 es vec2 screen02 = screen01 * 2.0; // Inflate quad by 1 pixel - float apron = 1.0; + float apron = 2.0; vec2 line_dir = normalize(a_line.zw - a_line.xy); vec2 up_dir = vec2(line_dir.y, -line_dir.x); vec2 pixel = vec2(2.0) / u_res * apron;