HalftoneShader.js 476 B

1234567891011121314151617181920212223242526
  1. /**
  2. * @author meatbags / http://xavierburrow.com/
  3. *
  4. * Colour halftone shader
  5. */
  6. THREE.HalftonShader = {
  7. uniforms: {
  8. "tDiffuse": {value: null},
  9. },
  10. vertexShader: `
  11. varying vec2 vUv;
  12. void main() {
  13. vUv = uv;
  14. gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
  15. }`,
  16. fragmentShader: `
  17. uniform sampler2D tDiffuse;
  18. varying vec2 vUv;
  19. void main() {
  20. vec4 color = texture2D(tDiffuse, vUv);
  21. gl_FragColor = color;
  22. }`
  23. };