|
|
@ -12,7 +12,6 @@ const sdf_vs_src = `#version 300 es |
|
|
|
uniform int u_stroke_count; |
|
|
|
uniform int u_stroke_count; |
|
|
|
uniform int u_stroke_texture_size; |
|
|
|
uniform int u_stroke_texture_size; |
|
|
|
uniform highp usampler2D u_stroke_data; |
|
|
|
uniform highp usampler2D u_stroke_data; |
|
|
|
uniform float u_fixed_pixel_width; |
|
|
|
|
|
|
|
uniform int u_circle_points; |
|
|
|
uniform int u_circle_points; |
|
|
|
|
|
|
|
|
|
|
|
out vec3 v_color; |
|
|
|
out vec3 v_color; |
|
|
@ -34,10 +33,6 @@ const sdf_vs_src = `#version 300 es |
|
|
|
uvec4 stroke_data = texelFetch(u_stroke_data, ivec2(stroke_data_x, stroke_data_y), 0); |
|
|
|
uvec4 stroke_data = texelFetch(u_stroke_data, ivec2(stroke_data_x, stroke_data_y), 0); |
|
|
|
float radius = float(stroke_data.w); |
|
|
|
float radius = float(stroke_data.w); |
|
|
|
|
|
|
|
|
|
|
|
if (u_fixed_pixel_width > 0.0) { |
|
|
|
|
|
|
|
radius = u_fixed_pixel_width / u_scale.x; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vec2 pos; |
|
|
|
vec2 pos; |
|
|
|
|
|
|
|
|
|
|
|
if (vertex_index < u_circle_points) { |
|
|
|
if (vertex_index < u_circle_points) { |
|
|
@ -88,7 +83,7 @@ const sdf_fs_src = `#version 300 es |
|
|
|
|
|
|
|
|
|
|
|
void main() { |
|
|
|
void main() { |
|
|
|
if (u_debug_mode == 0) { |
|
|
|
if (u_debug_mode == 0) { |
|
|
|
float alpha = 0.5; |
|
|
|
float alpha = 0.75; |
|
|
|
FragColor = vec4(v_color * alpha, alpha); |
|
|
|
FragColor = vec4(v_color * alpha, alpha); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
FragColor = vec4(0.2, 0.0, 0.0, 0.2); |
|
|
|
FragColor = vec4(0.2, 0.0, 0.0, 0.2); |
|
|
@ -327,10 +322,8 @@ function init_webgl(state, context) { |
|
|
|
gl.enable(gl.BLEND); |
|
|
|
gl.enable(gl.BLEND); |
|
|
|
gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA); |
|
|
|
gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA); |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
gl.enable(gl.DEPTH_TEST); |
|
|
|
gl.enable(gl.DEPTH_TEST); |
|
|
|
gl.depthFunc(gl.NOTEQUAL); |
|
|
|
gl.depthFunc(gl.NOTEQUAL); |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context.gpu_timer_ext = gl.getExtension('EXT_disjoint_timer_query_webgl2'); |
|
|
|
context.gpu_timer_ext = gl.getExtension('EXT_disjoint_timer_query_webgl2'); |
|
|
|
if (context.gpu_timer_ext === null) { |
|
|
|
if (context.gpu_timer_ext === null) { |
|
|
|