summaryrefslogtreecommitdiff
path: root/gfx/gl/shaders/networkCurve.vert
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2026-01-31 12:02:06 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2026-01-31 13:47:50 +0000
commit1d77f1ca38f88b79a39b418fe3dc7899887d186a (patch)
tree03c59728039e1eaa56924d088a2b256f9a0cd2e0 /gfx/gl/shaders/networkCurve.vert
parentRename shader source in keeping with glsl expectations (diff)
downloadilt-1d77f1ca38f88b79a39b418fe3dc7899887d186a.tar.bz2
ilt-1d77f1ca38f88b79a39b418fe3dc7899887d186a.tar.xz
ilt-1d77f1ca38f88b79a39b418fe3dc7899887d186a.zip
Tidy networkCurve shaders
Arrays for start/end position/angle, smaller centre position, dynamic segment count based on max error, calculate distance in tessellation evaluation, use start/end position directly to avoid rounding errors at joins. See https://schneide.blog/2025/05/21/calculating-the-number-of-segments-for-accurate-circle-rendering/
Diffstat (limited to 'gfx/gl/shaders/networkCurve.vert')
-rw-r--r--gfx/gl/shaders/networkCurve.vert22
1 files changed, 8 insertions, 14 deletions
diff --git a/gfx/gl/shaders/networkCurve.vert b/gfx/gl/shaders/networkCurve.vert
index 9cf149b..7e363d3 100644
--- a/gfx/gl/shaders/networkCurve.vert
+++ b/gfx/gl/shaders/networkCurve.vert
@@ -1,29 +1,23 @@
#version 460 core
-layout(location = 0) in ivec3 v_apos;
-layout(location = 1) in ivec3 v_bpos;
+layout(location = 0) in ivec3 v_pos[2];
layout(location = 2) in ivec3 v_centre;
layout(location = 3) in float v_reps;
-layout(location = 4) in float v_aangle;
-layout(location = 5) in float v_bangle;
+layout(location = 4) in float v_angles[2];
layout(location = 6) in float v_radius;
-flat out ivec3 apos;
-flat out ivec3 bpos;
-flat out ivec3 cpos;
+flat out ivec3 pos[2];
+flat out ivec2 cpos;
flat out float reps;
-flat out float aangle;
-flat out float bangle;
+flat out float angles[2];
flat out float radius;
void
main()
{
- apos = v_apos;
- bpos = v_bpos;
- cpos = v_centre;
+ pos = v_pos;
+ cpos = v_centre.xy;
reps = v_reps;
- aangle = v_aangle;
- bangle = v_bangle;
+ angles = v_angles;
radius = v_radius;
}