VideoTexture.js 899 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /**
  2. * @author mrdoob / http://mrdoob.com/
  3. */
  4. import { RGBFormat, LinearFilter } from '../constants.js';
  5. import { Texture } from './Texture.js';
  6. function VideoTexture( video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) {
  7. Texture.call( this, video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );
  8. this.format = format !== undefined ? format : RGBFormat;
  9. this.minFilter = minFilter !== undefined ? minFilter : LinearFilter;
  10. this.magFilter = magFilter !== undefined ? magFilter : LinearFilter;
  11. this.generateMipmaps = false;
  12. }
  13. VideoTexture.prototype = Object.assign( Object.create( Texture.prototype ), {
  14. constructor: VideoTexture,
  15. isVideoTexture: true,
  16. update: function () {
  17. var video = this.image;
  18. if ( video.readyState >= video.HAVE_CURRENT_DATA ) {
  19. this.needsUpdate = true;
  20. }
  21. }
  22. } );
  23. export { VideoTexture };
粤ICP备19079148号