@threlte/extras
Version:
Utilities, abstractions and plugins for your Threlte apps
2 lines (1 loc) • 897 B
TypeScript
export declare const fragmentShader = "\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n\nuniform float useDash;\nuniform float dashArray;\nuniform float dashOffset;\nuniform float dashRatio;\nuniform sampler2D alphaMap;\nuniform float useAlphaMap;\n\nvarying vec2 vUV;\nvarying vec4 vColor;\nvarying float vCounters;\n\nvec4 CustomLinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\n\nvoid main()\t{\n\t#include <logdepthbuf_fragment>\n\t#include <colorspace_fragment>\n\n\tvec4 c = vColor;\n\n\tif( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV ).r;\n\n\tif( useDash == 1. ){\n\t\t\tc.a *= ceil(mod(vCounters + dashOffset, dashArray) - (dashArray * dashRatio));\n\t}\n\n\tgl_FragColor = CustomLinearTosRGB(c);\n}\n";