| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>VideoTexture - Three.js Docs</title>
- <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
- <script src="../scripts/highlight.min.js"></script>
- <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
- <link type="text/css" rel="stylesheet" href="../styles/page.css">
- </head>
- <body>
- <p class="inheritance" translate="no"><a href="EventDispatcher.html">EventDispatcher</a> → <a href="Texture.html">Texture</a> → </p>
- <h1 translate="no">VideoTexture</h1>
- <section>
- <header>
- <div class="class-description"><p>A texture for use with a video.</p>
- <p>Note: When using video textures with <a href="WebGPURenderer.html">WebGPURenderer</a>, <a href="Texture.html#colorSpace">Texture#colorSpace</a> must be
- set to THREE.SRGBColorSpace.</p>
- <p>Note: After the initial use of a texture, its dimensions, format, and type
- cannot be changed. Instead, call <a href="Texture.html#dispose">Texture#dispose</a> on the texture and instantiate a new one.</p></div>
- <h2>Code Example</h2>
- <div translate="no"><pre><code class="language-js">// assuming you have created a HTML video element with id="video"
- const video = document.getElementById( 'video' );
- const texture = new THREE.VideoTexture( video );
- </code></pre></div>
- </header>
- <article>
- <div class="container-overview">
- <h2>Constructor</h2>
- <h3 class="name name-method" id="VideoTexture" translate="no">new <a href="#VideoTexture">VideoTexture</a><span class="signature">( video : <span class="param-type">HTMLVideoElement</span>, mapping : <span class="param-type">number</span>, wrapS : <span class="param-type">number</span>, wrapT : <span class="param-type">number</span>, magFilter : <span class="param-type">number</span>, minFilter : <span class="param-type">number</span>, format : <span class="param-type">number</span>, type : <span class="param-type">number</span>, anisotropy : <span class="param-type">number</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Constructs a new video texture.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>video</strong>
- </td>
- <td class="description last">
- <p>The video element to use as a data source for the texture.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>mapping</strong>
- </td>
- <td class="description last">
- <p>The texture mapping.</p>
- <p>Default is <code>Texture.DEFAULT_MAPPING</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>wrapS</strong>
- </td>
- <td class="description last">
- <p>The wrapS value.</p>
- <p>Default is <code>ClampToEdgeWrapping</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>wrapT</strong>
- </td>
- <td class="description last">
- <p>The wrapT value.</p>
- <p>Default is <code>ClampToEdgeWrapping</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>magFilter</strong>
- </td>
- <td class="description last">
- <p>The mag filter value.</p>
- <p>Default is <code>LinearFilter</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>minFilter</strong>
- </td>
- <td class="description last">
- <p>The min filter value.</p>
- <p>Default is <code>LinearFilter</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>format</strong>
- </td>
- <td class="description last">
- <p>The texture format.</p>
- <p>Default is <code>RGBAFormat</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>type</strong>
- </td>
- <td class="description last">
- <p>The texture type.</p>
- <p>Default is <code>UnsignedByteType</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>anisotropy</strong>
- </td>
- <td class="description last">
- <p>The anisotropy value.</p>
- <p>Default is <code>Texture.DEFAULT_ANISOTROPY</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <h2 class="subsection-title">Properties</h2>
- <div class="member">
- <h3 class="name" id="generateMipmaps" translate="no">.<a href="#generateMipmaps">generateMipmaps</a><span class="type-signature"> : boolean</span> </h3>
- <div class="description">
- <p>Whether to generate mipmaps (if possible) for a texture.</p>
- <p>Overwritten and set to <code>false</code> by default.</p>
- <p>Default is <code>false</code>.</p>
- </div>
- <dl class="details">
- <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Texture.html#generateMipmaps">Texture#generateMipmaps</a></dt>
- </dl>
- </div>
- <div class="member">
- <h3 class="name" id="isVideoTexture" translate="no">.<a href="#isVideoTexture">isVideoTexture</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
- <div class="description">
- <p>This flag can be used for type testing.</p>
- <p>Default is <code>true</code>.</p>
- </div>
- </div>
- <h2 class="subsection-title">Methods</h2>
- <h3 class="name name-method" id="update" translate="no">.<a href="#update">update</a><span class="signature">()</span> </h3>
- <div class="method">
- <div class="description">
- <p>This method is called automatically by the renderer and sets <a href="Texture.html#needsUpdate">Texture#needsUpdate</a>
- to <code>true</code> every time a new frame is available.</p>
- <p>Only relevant if <code>requestVideoFrameCallback</code> is not supported in the browser.</p>
- </div>
- </div>
- <h2 class="subsection-title">Source</h2>
- <p>
- <a href="https://github.com/mrdoob/three.js/blob/master/src/textures/VideoTexture.js" translate="no" target="_blank" rel="noopener">src/textures/VideoTexture.js</a>
- </p>
- </article>
- </section>
- <script src="../scripts/linenumber.js"></script>
- <script src="../scripts/page.js"></script>
- </body>
- </html>
|