CopyShader.js 954 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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/index.html#manual/en/introduction/Import-via-modules." );
  2. /**
  3. * @author alteredq / http://alteredqualia.com/
  4. *
  5. * Full-screen textured quad shader
  6. */
  7. THREE.CopyShader = {
  8. uniforms: {
  9. "tDiffuse": { value: null },
  10. "opacity": { value: 1.0 }
  11. },
  12. vertexShader: [
  13. "varying vec2 vUv;",
  14. "void main() {",
  15. " vUv = uv;",
  16. " gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
  17. "}"
  18. ].join( "\n" ),
  19. fragmentShader: [
  20. "uniform float opacity;",
  21. "uniform sampler2D tDiffuse;",
  22. "varying vec2 vUv;",
  23. "void main() {",
  24. " vec4 texel = texture2D( tDiffuse, vUv );",
  25. " gl_FragColor = opacity * texel;",
  26. "}"
  27. ].join( "\n" )
  28. };