物管理前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
639 B

  1. (function () {
  2. /**
  3. * Full-screen textured quad shader
  4. */
  5. const CopyShader = {
  6. uniforms: {
  7. tDiffuse: {
  8. value: null
  9. },
  10. opacity: {
  11. value: 1.0
  12. }
  13. },
  14. vertexShader:
  15. /* glsl */
  16. `
  17. varying vec2 vUv;
  18. void main() {
  19. vUv = uv;
  20. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  21. }`,
  22. fragmentShader:
  23. /* glsl */
  24. `
  25. uniform float opacity;
  26. uniform sampler2D tDiffuse;
  27. varying vec2 vUv;
  28. void main() {
  29. gl_FragColor = texture2D( tDiffuse, vUv );
  30. gl_FragColor.a *= opacity;
  31. }`
  32. };
  33. THREE.CopyShader = CopyShader;
  34. })();