0
0

CopyShader.js 546 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /**
  2. * Full-screen textured quad shader
  3. */
  4. var CopyShader = {
  5. uniforms: {
  6. 'tDiffuse': { value: null },
  7. 'opacity': { value: 1.0 }
  8. },
  9. vertexShader: /* glsl */`
  10. varying vec2 vUv;
  11. void main() {
  12. vUv = uv;
  13. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  14. }`,
  15. fragmentShader: /* glsl */`
  16. uniform float opacity;
  17. uniform sampler2D tDiffuse;
  18. varying vec2 vUv;
  19. void main() {
  20. vec4 texel = texture2D( tDiffuse, vUv );
  21. gl_FragColor = opacity * texel;
  22. }`
  23. };
  24. export { CopyShader };