@threlte/extras
Version:
Utilities, abstractions and plugins for your Threlte apps
33 lines (24 loc) • 638 B
JavaScript
export const fragmentShader = `
uniform float useDash;
uniform float dashArray;
uniform float dashOffset;
uniform float dashRatio;
uniform sampler2D alphaMap;
uniform float useAlphaMap;
varying vec2 vUV;
varying vec4 vColor;
varying float vCounters;
void main() {
vec4 c = vColor;
if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV ).r;
if( useDash == 1. ){
c.a *= ceil(mod(vCounters + dashOffset, dashArray) - (dashArray * dashRatio));
}
gl_FragColor = c;
}
`;