summaryrefslogtreecommitdiff
path: root/gfx/gl
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-01-21 03:27:01 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-01-21 03:27:01 +0000
commitfb3e42e2d13138865d5eb40a0f65ef14e67f995b (patch)
tree58ba5e750d33411ffb0a231eb219e80e769bf8a9 /gfx/gl
parentUse symbol GL_MAX_GEOMETRY_OUTPUT_VERTICES to lookup the implementation limit... (diff)
downloadilt-fb3e42e2d13138865d5eb40a0f65ef14e67f995b.tar.bz2
ilt-fb3e42e2d13138865d5eb40a0f65ef14e67f995b.tar.xz
ilt-fb3e42e2d13138865d5eb40a0f65ef14e67f995b.zip
Dynamic number of segments into curve render
Simpler formula than the old one, neither scientific, needs to tests to demonstrate a decent result for whatever formula we use.
Diffstat (limited to 'gfx/gl')
-rw-r--r--gfx/gl/shaders/networkCurve.gs3
1 files changed, 2 insertions, 1 deletions
diff --git a/gfx/gl/shaders/networkCurve.gs b/gfx/gl/shaders/networkCurve.gs
index 326e8b6..619625f 100644
--- a/gfx/gl/shaders/networkCurve.gs
+++ b/gfx/gl/shaders/networkCurve.gs
@@ -24,7 +24,8 @@ getRot(float angle)
void
main()
{
- float segs = floor(GL_MAX_GEOMETRY_OUTPUT_VERTICES / (profile.length() * 2));
+ float segs = clamp(
+ round(reps[0] * radius[0] / 1000), 4, floor(GL_MAX_GEOMETRY_OUTPUT_VERTICES / (profile.length() * 2)));
vec3 arcstep = vec3((bangle[0] - aangle[0]), // angle
reps[0], // texture
(bpos[0].z - apos[0].z)) // height