Capítulo 240 de 859
A texture for use with a video.
Note: When using video textures with WebGPURenderer, Texture#colorSpace must be set to THREE.SRGBColorSpace.
Note: After the initial use of a texture, its dimensions, format, and type cannot be changed. Instead, call Texture#dispose on the texture and instantiate a new one.
// assuming you have created a HTML video element with id="video"
const video = document.getElementById( 'video' );
const texture = new THREE.VideoTexture( video );
Constructor
| Signature |
|---|
new VideoTexture( video : HTMLVideoElement, mapping : number, wrapS : number, wrapT : number, magFilter : number, minFilter : number, format : number, type : number, anisotropy : number ) |
Properties
| Property | Description |
|---|---|
.generateMipmaps : boolean | Whether to generate mipmaps (if possible) for a texture. |
.isVideoTexture : boolean (readonly) | This flag can be used for type testing. |
Methods
| Method | Description |
|---|---|
.update() | This method is called automatically by the renderer and sets Texture#needsUpdate to true every time a new frame is available. |