Browse Source

Fix z range which sometimes caused the last stroke to have Z equal to

exactly 1 and thus not draw. Fix wrong size of texture upload
sdf
A.Olokhtonov 1 week ago
parent
commit
8ffc5b99b5
  1. 2
      client/webgl_draw.js
  2. 2
      client/webgl_shaders.js

2
client/webgl_draw.js

@ -61,7 +61,7 @@ function upload_square_rgba16ui_texture(gl, serializer, texture_size) { @@ -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;

2
client/webgl_shaders.js

@ -68,7 +68,7 @@ const sdf_vs_src = `#version 300 es @@ -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);
}
`;

Loading…
Cancel
Save