diff --git a/client/webgl_draw.js b/client/webgl_draw.js index b10fba8..783df61 100644 --- a/client/webgl_draw.js +++ b/client/webgl_draw.js @@ -61,7 +61,7 @@ function upload_square_rgba16ui_texture(gl, serializer, texture_size) { // Upload last row if (last_row > 0) { const last_row_upload = last_row * bpp; - gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, rows_uploaded, last_row, 1, gl.RGBA_INTEGER, gl.UNSIGNED_SHORT, new Uint16Array(serializer.buffer, whole_upload, last_row_upload * 4)); + gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, rows_uploaded, last_row, 1, gl.RGBA_INTEGER, gl.UNSIGNED_SHORT, new Uint16Array(serializer.buffer, whole_upload, last_row_upload)); } serializer.gpu_upload_from = serializer.offset; diff --git a/client/webgl_shaders.js b/client/webgl_shaders.js index 123d768..0ec0773 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 + 1) / float(u_stroke_count)) * 2.0 - 1.0, 1.0); + gl_Position = vec4(screen02 - 1.0, (float(stroke_index + 1) / float(u_stroke_count + 1)) * 2.0 - 1.0, 1.0); } `;