GUI: new osc renderer, part 19

now with a setting
This commit is contained in:
tildearrow 2024-02-19 02:57:48 -05:00
parent c9b1305b61
commit 894b1f5a3c
6 changed files with 28 additions and 9 deletions

View file

@ -178,14 +178,14 @@ const char* sh_oscRender_srcF=
" if (val<valmin) valmin=val;\n"
" }\n"
" float slope=abs(valmax-valmin)*uResolution.y*0.5;\n"
" float slopeDiv=min(uAdvance,2.0*(uAdvance/slope));\n"
" float slopeDiv=min(uAdvance,(uAdvance/slope));\n"
" float xRight=uv.x+((uLineWidth)/uResolution.x);\n"
" for (float x=max(0.0,uv.x-(uLineWidth/uResolution.x)); x<=xRight; x+=slopeDiv) {\n"
" float val=texture(oscVal,x).x*uResolution.y*0.5;\n"
" alpha+=clamp(uLineWidth-distance(vec2(fur_fragCoord.x,fur_fragCoord.y),vec2(x*uResolution.x,val)),0.0,1.0);\n"
" }\n"
" if (slope>1.0) {\n"
" fur_FragColor = vec4(uColor.xyz,uColor.w*clamp(alpha/uLineWidth,0.0,1.0));\n"
" fur_FragColor = vec4(uColor.xyz,uColor.w*clamp(alpha/(uLineWidth+sqrt(slope*0.125)),0.0,1.0));\n"
" } else {\n"
" fur_FragColor = vec4(uColor.xyz,uColor.w*clamp(alpha/uLineWidth,0.0,1.0));\n"
" }\n"