GUI: new osc renderer, part 30

This commit is contained in:
tildearrow 2024-02-22 19:06:57 -05:00
parent c5d0203f94
commit 7a2e26c6e5
2 changed files with 2 additions and 3 deletions

View file

@ -1,5 +1,4 @@
# to-do
- finish auto-clone
- new oscilloscope renderer - custom code that uses texture and fixes two issues: too many vertices, and broken anti-aliasing
- new pattern renderer - performance improvements

View file

@ -116,8 +116,8 @@ const char* sh_oscRender_srcF=
" }\n"
" if ((fur_fragCoord.y-uLineWidth)>valmax*uResolution.y) discard;\n"
" if ((fur_fragCoord.y+uLineWidth)<valmin*uResolution.y) discard;\n"
" float slope=abs(valmax-valmin)*uResolution.y;\n"
" float slopeDiv=min(1.0,2.0/ceil(slope));\n"
" float slope=sqrt(abs(valmax-valmin)*uResolution.y);\n"
" float slopeDiv=min(1.0,1.0/ceil(slope));\n"
" float xRight=ceil(fur_fragCoord.x+uLineWidth);\n"
" for (float x=max(0.0,floor(fur_fragCoord.x-uLineWidth)); x<=xRight; x+=slopeDiv) {\n"
" float val0=texture2D(oscVal,vec2(floor(x)*oneStep,1.0)).x*uResolution.y;\n"