|
|
|
@ -164,6 +164,18 @@ function draw(state, context) {
@@ -164,6 +164,18 @@ function draw(state, context) {
|
|
|
|
|
const dynamic_points = context.dynamic_serializer.offset / config.bytes_per_point; |
|
|
|
|
|
|
|
|
|
if (dynamic_points > 0) { |
|
|
|
|
gl.drawBuffers([gl.BACK]); |
|
|
|
|
|
|
|
|
|
locations = context.locations['sdf'].main; |
|
|
|
|
|
|
|
|
|
gl.useProgram(context.programs['sdf'].main); |
|
|
|
|
|
|
|
|
|
gl.uniform2f(locations['u_res'], context.canvas.width, context.canvas.height); |
|
|
|
|
gl.uniform2f(locations['u_scale'], state.canvas.zoom, state.canvas.zoom); |
|
|
|
|
gl.uniform2f(locations['u_translation'], state.canvas.offset.x, state.canvas.offset.y); |
|
|
|
|
gl.uniform1i(locations['u_stroke_count'], state.stroke_count); |
|
|
|
|
gl.uniform1i(locations['u_debug_mode'], state.debug.red); |
|
|
|
|
|
|
|
|
|
gl.clear(gl.DEPTH_BUFFER_BIT); |
|
|
|
|
gl.bindBuffer(gl.ARRAY_BUFFER, buffers['b_packed_dynamic']); |
|
|
|
|
|
|
|
|
|