CopyShader.js 887 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. console.warn( "THREE.CopyShader: As part of the transition to ES6 Modules, the files in 'examples/js' were deprecated in May 2020 (r117) and will be deleted in December 2020 (r124). You can find more information about developing using ES6 Modules in https://threejs.org/docs/#manual/en/introduction/Installation." );
  2. /**
  3. * Full-screen textured quad shader
  4. */
  5. THREE.CopyShader = {
  6. uniforms: {
  7. "tDiffuse": { value: null },
  8. "opacity": { value: 1.0 }
  9. },
  10. vertexShader: [
  11. "varying vec2 vUv;",
  12. "void main() {",
  13. " vUv = uv;",
  14. " gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
  15. "}"
  16. ].join( "\n" ),
  17. fragmentShader: [
  18. "uniform float opacity;",
  19. "uniform sampler2D tDiffuse;",
  20. "varying vec2 vUv;",
  21. "void main() {",
  22. " vec4 texel = texture2D( tDiffuse, vUv );",
  23. " gl_FragColor = opacity * texel;",
  24. "}"
  25. ].join( "\n" )
  26. };