mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-30 00:13:03 +00:00
afsdfadsfasd
This commit is contained in:
parent
e4f6dfed20
commit
2c32ee47b0
1 changed files with 19 additions and 16 deletions
|
@ -168,26 +168,29 @@ const char* sh_oscRender_srcF=
|
|||
" vec2 uv = fur_fragCoord/uResolution;\n"
|
||||
" uv.y *= 2.0;\n"
|
||||
" vec2 tresh = vec2(1.0,1.0)/uResolution;\n"
|
||||
" float x1 = uv.x-uAdvance;\n"
|
||||
" float x2 = uv.x;\n"
|
||||
" float x3 = uv.x+uAdvance;\n"
|
||||
" float val1 = texture(oscVal,x1).x;\n"
|
||||
" float val2 = texture(oscVal,x2).x;\n"
|
||||
" float val3 = texture(oscVal,x3).x;\n"
|
||||
" float valmax = max(max(val1,val2),val3);\n"
|
||||
" float valmin = min(min(val1,val2),val3);\n"
|
||||
" float slope = abs(valmax-valmin)*uResolution.y*0.5;\n"
|
||||
" float x = uv.x-uAdvance*uLineWidth*0.5;\n"
|
||||
" float xMax = uv.x+uAdvance*uLineWidth*0.5;\n"
|
||||
" float alphaX = 0.0;\n"
|
||||
" float alpha = 0.0;\n"
|
||||
" if (uv.y>=valmin) {\n"
|
||||
" alpha=valmax*uResolution.y*0.5-fur_fragCoord.y+uLineWidth*0.75;\n"
|
||||
" } else {\n"
|
||||
" alpha=fur_fragCoord.y-valmin*uResolution.y*0.5+uLineWidth*0.75;\n"
|
||||
" float valmax = -1024.0;\n"
|
||||
" float valmin = 1024.0;\n"
|
||||
" for (; x<xMax; x+=uAdvance) {\n"
|
||||
" float val=texture(oscVal,x).x;\n"
|
||||
" alphaX+=0;\n"
|
||||
" if (val>valmax) valmax=val;\n"
|
||||
" if (val<valmin) valmin=val;\n"
|
||||
" }\n"
|
||||
" float slope = abs(valmax-valmin)*uResolution.y*0.5;\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"
|
||||
" alpha=clamp(alpha,0.0,1.0);\n"
|
||||
" if (slope>1.0) {\n"
|
||||
" fur_FragColor = vec4(uColor.xyz,uColor.w*clamp(alpha,0.0,1.0));\n"
|
||||
" } else {\n"
|
||||
" fur_FragColor = vec4(uColor.xyz,uColor.w*clamp(alpha,0.0,1.0));\n"
|
||||
" alpha*=clamp(alphaX,0.0,1.0);\n"
|
||||
" }\n"
|
||||
" gl_FragColor = vec4(uColor.xyz,uColor.w*clamp(alpha,0.0,1.0));\n"
|
||||
"}\n";
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue