diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-20 23:27:01 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-20 23:27:01 +0000 |
commit | 35a9f035963458156c719dc16f4073b8244d66eb (patch) | |
tree | 4a96298e2be58dd4d55fafb612d1bfdd855091f5 /gfx/gl/shaders/networkCurve.gs | |
parent | Implement basic network curve part shader (diff) | |
download | ilt-35a9f035963458156c719dc16f4073b8244d66eb.tar.bz2 ilt-35a9f035963458156c719dc16f4073b8244d66eb.tar.xz ilt-35a9f035963458156c719dc16f4073b8244d66eb.zip |
Pass curve link radius, no recalculate, its constant
Diffstat (limited to 'gfx/gl/shaders/networkCurve.gs')
-rw-r--r-- | gfx/gl/shaders/networkCurve.gs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gfx/gl/shaders/networkCurve.gs b/gfx/gl/shaders/networkCurve.gs index 82d8c59..d373c0c 100644 --- a/gfx/gl/shaders/networkCurve.gs +++ b/gfx/gl/shaders/networkCurve.gs @@ -6,6 +6,7 @@ flat in ivec3 cpos[]; flat in float reps[]; flat in float aangle[]; flat in float bangle[]; +flat in float radius[]; layout(points) in; layout(triangle_strip, max_vertices = 255) out; @@ -24,7 +25,6 @@ void main() { float segs = floor(255 / (profile.length() * 2)); - float radius = distance(cpos[0], apos[0]); vec3 arcstep = vec3((bangle[0] - aangle[0]), // angle reps[0], // texture (bpos[0].z - apos[0].z)) // height @@ -35,7 +35,7 @@ main() float prevTex = 0; for (vec3 arc = arcstep; arc.y < reps[0] - 0.01; arc += arcstep) { mat2 rot = getRot(arc.x + aangle[0]); - ivec3 pos = cpos[0] + ivec3(rot * vec2(radius, 0), arc.z); + ivec3 pos = cpos[0] + ivec3(rot * vec2(radius[0], 0), arc.z); float tex = arc.y; doSeg(segDist(prevPos, pos), pos, prevPos, tex, prevTex, rot, prevRot); prevPos = pos; |