From 4242e791449b21ebdf75a6d0a6988ac1527b415f Mon Sep 17 00:00:00 2001 From: tildearrow Date: Tue, 13 Feb 2024 17:35:23 -0500 Subject: [PATCH] GUI: new osc renderer, part 11 --- src/gui/render/renderGL.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/render/renderGL.cpp b/src/gui/render/renderGL.cpp index e83e98b79..b3fe689d9 100644 --- a/src/gui/render/renderGL.cpp +++ b/src/gui/render/renderGL.cpp @@ -113,14 +113,18 @@ const char* sh_oscRender_srcF= " float val3 = texture2D(oscVal,vec2(x3,1.0)).x;\n" " float valmax = max(max(val1,val2),val3);\n" " float valmin = min(min(val1,val2),val3);\n" - " float vald = abs(valmax-valmin);\n" + " float slope = abs(valmax-valmin)*uResolution.y*0.5;\n" " float alpha = 0.0;\n" " if (uv.y>valmin) {\n" " alpha=valmax*uResolution.y*0.5-fur_fragCoord.y+uLineWidth*0.5;\n" " } else {\n" " alpha=fur_fragCoord.y-valmin*uResolution.y*0.5+uLineWidth*0.5;\n" " }\n" - " gl_FragColor = vec4(uColor.xyz,uColor.w*clamp(alpha,0.0,1.0));\n" + " if (slope>1.0) {\n" + " gl_FragColor = vec4(0.0,1.0,0.0,uColor.w*clamp(alpha,0.0,1.0));\n" + " } else {\n" + " gl_FragColor = vec4(uColor.xyz,uColor.w*clamp(alpha,0.0,1.0));\n" + " }\n" "}\n"; #else const char* sh_wipe_srcV=