update default thickness to match with previous lineWidth user were interested of

This commit is contained in:
Matthieu Baumann
2025-08-29 15:28:32 +02:00
committed by Matthieu Baumann
parent 0c9c315f69
commit d6583e47ef
4 changed files with 7 additions and 5 deletions

View File

@@ -17,7 +17,9 @@ void main() {
color = u_color;
// distance from line to compute the anti-aliasing
float dist = abs(u_thickness * l.y);
color.a = color.a * (1.0 - smoothstep(u_thickness*0.5 - 1.0, u_thickness*0.5, dist));
float dist = abs((u_thickness + 2.0) * l.y);
float half_thickness = (u_thickness + 2.0) * 0.5;
color.a = color.a * (1.0 - smoothstep(half_thickness - 1.0, half_thickness, dist));
}
}

View File

@@ -38,7 +38,7 @@ void main() {
float ndc2pix = 2.0 / u_width;
vec2 p_ndc_x = x_b * vertex.x;
vec2 p_ndc_y = u_thickness * y_b * vertex.y * vec2(1.0, u_width/u_height) * ndc2pix;
vec2 p_ndc_y = (u_thickness + 2.0) * y_b * vertex.y * vec2(1.0, u_width/u_height) * ndc2pix;
vec2 p_ndc = p_a_ndc + p_ndc_x + p_ndc_y;
gl_Position = vec4(p_ndc, 0.f, 1.f);

View File

@@ -16,7 +16,7 @@ void main() {
float ndc2pix = 2.0 / u_width;
vec2 p = p_a + x_b * vertex.x + u_thickness * y_b * vertex.y * vec2(1.0, u_width/u_height) * ndc2pix;
vec2 p = p_a + x_b * vertex.x + (u_thickness + 2.0) * y_b * vertex.y * vec2(1.0, u_width/u_height) * ndc2pix;
gl_Position = vec4(p, 0.f, 1.f);
l = vec2(0.0, vertex.y);
}

View File

@@ -732,7 +732,7 @@ export let Aladin = (function () {
reticleColor: "rgb(178, 50, 178)",
reticleSize: 22,
gridColor: "rgb(178, 50, 178)",
gridOpacity: 0.4,
gridOpacity: 0.8,
gridOptions: {
enabled: false,
showLabels: true,