glowMapMerge.fragment.fx 418 B

1234567891011121314151617181920
  1. // Samplers
  2. varying vec2 vUV;
  3. uniform sampler2D textureSampler;
  4. // Offset
  5. uniform float offset;
  6. void main(void) {
  7. vec4 baseColor = texture2D(textureSampler, vUV);
  8. baseColor.a = abs(offset - baseColor.a);
  9. #ifdef STROKE
  10. float alpha = smoothstep(.0, .1, baseColor.a);
  11. baseColor.a = alpha;
  12. baseColor.rgb = baseColor.rgb * alpha;
  13. #endif
  14. gl_FragColor = baseColor;
  15. }