ExposureShader.js 620 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /** @module ExposureShader */
  2. /**
  3. * TODO
  4. *
  5. * @constant
  6. * @type {Object}
  7. */
  8. const ExposureShader = {
  9. name: 'ExposureShader',
  10. uniforms: {
  11. 'tDiffuse': { value: null },
  12. 'exposure': { value: 1.0 }
  13. },
  14. vertexShader: /* glsl */`
  15. varying vec2 vUv;
  16. void main() {
  17. vUv = uv;
  18. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  19. }`,
  20. fragmentShader: /* glsl */`
  21. uniform float exposure;
  22. uniform sampler2D tDiffuse;
  23. varying vec2 vUv;
  24. void main() {
  25. gl_FragColor = texture2D( tDiffuse, vUv );
  26. gl_FragColor.rgb *= exposure;
  27. }`
  28. };
  29. export { ExposureShader };
粤ICP备19079148号