UNPKG

@threlte/extras

Version:

Utilities, abstractions and plugins for your Threlte apps

33 lines (24 loc) 638 B
export const fragmentShader = ` #include <fog_pars_fragment> #include <logdepthbuf_pars_fragment> 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() { #include <logdepthbuf_fragment> 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; #include <colorspace_fragment> #include <fog_fragment> } `;