| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>FramebufferTexture - 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">FramebufferTexture</h1>
- <section>
- <header>
- <div class="class-description"><p>This class can only be used in combination with <code>copyFramebufferToTexture()</code> methods
- of renderers. It extracts the contents of the current bound framebuffer and provides it
- as a texture for further usage.</p></div>
- <h2>Code Example</h2>
- <div translate="no"><pre><code class="language-js">const pixelRatio = window.devicePixelRatio;
- const textureSize = 128 * pixelRatio;
- const frameTexture = new FramebufferTexture( textureSize, textureSize );
- // calculate start position for copying part of the frame data
- const vector = new Vector2();
- vector.x = ( window.innerWidth * pixelRatio / 2 ) - ( textureSize / 2 );
- vector.y = ( window.innerHeight * pixelRatio / 2 ) - ( textureSize / 2 );
- renderer.render( scene, camera );
- // copy part of the rendered frame into the framebuffer texture
- renderer.copyFramebufferToTexture( frameTexture, vector );
- </code></pre></div>
- </header>
- <article>
- <div class="container-overview">
- <h2>Constructor</h2>
- <h3 class="name name-method" id="FramebufferTexture" translate="no">new <a href="#FramebufferTexture">FramebufferTexture</a><span class="signature">( width : <span class="param-type">number</span>, height : <span class="param-type">number</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Constructs a new framebuffer texture.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>width</strong>
- </td>
- <td class="description last">
- <p>The width of the texture.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong>height</strong>
- </td>
- <td class="description last">
- <p>The height of the texture.</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="isFramebufferTexture" translate="no">.<a href="#isFramebufferTexture">isFramebufferTexture</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>
- <div class="member">
- <h3 class="name" id="magFilter" translate="no">.<a href="#magFilter">magFilter</a><span class="type-signature"> : <a href="global.html#NearestFilter">NearestFilter</a> | <a href="global.html#NearestMipmapNearestFilter">NearestMipmapNearestFilter</a> | <a href="global.html#NearestMipmapLinearFilter">NearestMipmapLinearFilter</a> | <a href="global.html#LinearFilter">LinearFilter</a> | <a href="global.html#LinearMipmapNearestFilter">LinearMipmapNearestFilter</a> | <a href="global.html#LinearMipmapLinearFilter">LinearMipmapLinearFilter</a></span> </h3>
- <div class="description">
- <p>How the texture is sampled when a texel covers more than one pixel.</p>
- <p>Overwritten and set to <code>NearestFilter</code> by default to disable filtering.</p>
- <p>Default is <code>NearestFilter</code>.</p>
- </div>
- <dl class="details">
- <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Texture.html#magFilter">Texture#magFilter</a></dt>
- </dl>
- </div>
- <div class="member">
- <h3 class="name" id="minFilter" translate="no">.<a href="#minFilter">minFilter</a><span class="type-signature"> : <a href="global.html#NearestFilter">NearestFilter</a> | <a href="global.html#NearestMipmapNearestFilter">NearestMipmapNearestFilter</a> | <a href="global.html#NearestMipmapLinearFilter">NearestMipmapLinearFilter</a> | <a href="global.html#LinearFilter">LinearFilter</a> | <a href="global.html#LinearMipmapNearestFilter">LinearMipmapNearestFilter</a> | <a href="global.html#LinearMipmapLinearFilter">LinearMipmapLinearFilter</a></span> </h3>
- <div class="description">
- <p>How the texture is sampled when a texel covers less than one pixel.</p>
- <p>Overwritten and set to <code>NearestFilter</code> by default to disable filtering.</p>
- <p>Default is <code>NearestFilter</code>.</p>
- </div>
- <dl class="details">
- <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Texture.html#minFilter">Texture#minFilter</a></dt>
- </dl>
- </div>
- <h2 class="subsection-title">Source</h2>
- <p>
- <a href="https://github.com/mrdoob/three.js/blob/master/src/textures/FramebufferTexture.js" translate="no" target="_blank" rel="noopener">src/textures/FramebufferTexture.js</a>
- </p>
- </article>
- </section>
- <script src="../scripts/linenumber.js"></script>
- <script src="../scripts/page.js"></script>
- </body>
- </html>
|