ViewportTextureNode.html 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>ViewportTextureNode - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <p class="inheritance" translate="no"><a href="EventDispatcher.html">EventDispatcher</a> → <a href="Node.html">Node</a> → <a href="InputNode.html">InputNode</a> → <a href="UniformNode.html">UniformNode</a> → <a href="TextureNode.html">TextureNode</a> → </p>
  13. <h1 translate="no">ViewportTextureNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A special type of texture node which represents the data of the current viewport
  17. as a texture. The module extracts data from the current bound framebuffer with
  18. a copy operation so no extra render pass is required to produce the texture data
  19. (which is good for performance). <code>ViewportTextureNode</code> can be used as an input for a
  20. variety of effects like refractive or transmissive materials.</p></div>
  21. </header>
  22. <article>
  23. <div class="container-overview">
  24. <h2>Constructor</h2>
  25. <h3 class="name name-method" id="ViewportTextureNode" translate="no">new <a href="#ViewportTextureNode">ViewportTextureNode</a><span class="signature">( uvNode : <span class="param-type">Node</span>, levelNode : <span class="param-type">Node</span>, framebufferTexture : <span class="param-type">Texture</span> )</span> </h3>
  26. <div class="method">
  27. <div class="description">
  28. <p>Constructs a new viewport texture node.</p>
  29. </div>
  30. <table class="params">
  31. <tbody>
  32. <tr>
  33. <td class="name"><code>uvNode</code></td>
  34. <td class="description last"><p>The uv node.<br/>Default is <code>screenUV</code>.</p></td>
  35. </tr>
  36. <tr>
  37. <td class="name"><code>levelNode</code></td>
  38. <td class="description last"><p>The level node.<br/>Default is <code>null</code>.</p></td>
  39. </tr>
  40. <tr>
  41. <td class="name"><code>framebufferTexture</code></td>
  42. <td class="description last"><p>A framebuffer texture holding the viewport data. If not provided, a framebuffer texture is created automatically.<br/>Default is <code>null</code>.</p></td>
  43. </tr>
  44. </tbody>
  45. </table>
  46. </div>
  47. </div>
  48. <h2 class="subsection-title">Properties</h2>
  49. <div class="member">
  50. <h3 class="name" id="defaultFramebuffer" translate="no">.<a href="#defaultFramebuffer">defaultFramebuffer</a><span class="type-signature"> : <a href="FramebufferTexture.html">FramebufferTexture</a></span> </h3>
  51. <div class="description">
  52. <p>The reference framebuffer texture. This is used to store the framebuffer texture
  53. for the current render target. If the render target changes, a new framebuffer texture
  54. is created automatically.<br/>Default is <code>null</code>.</p>
  55. </div>
  56. </div>
  57. <div class="member">
  58. <h3 class="name" id="generateMipmaps" translate="no">.<a href="#generateMipmaps">generateMipmaps</a><span class="type-signature"> : boolean</span> </h3>
  59. <div class="description">
  60. <p>Whether to generate mipmaps or not.<br/>Default is <code>false</code>.</p>
  61. </div>
  62. </div>
  63. <div class="member">
  64. <h3 class="name" id="isOutputTextureNode" translate="no">.<a href="#isOutputTextureNode">isOutputTextureNode</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  65. <div class="description">
  66. <p>This flag can be used for type testing.<br/>Default is <code>true</code>.</p>
  67. </div>
  68. </div>
  69. <div class="member">
  70. <h3 class="name" id="updateBeforeType" translate="no">.<a href="#updateBeforeType">updateBeforeType</a><span class="type-signature"> : string</span> </h3>
  71. <div class="description">
  72. <p>The <code>updateBeforeType</code> is set to <code>NodeUpdateType.FRAME</code> since the node renders the
  73. scene once per frame in its <a href="ViewportTextureNode.html#updateBefore">ViewportTextureNode#updateBefore</a> method.<br/>Default is <code>'frame'</code>.</p>
  74. </div>
  75. <dl class="details">
  76. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TextureNode.html#updateBeforeType">TextureNode#updateBeforeType</a></dt>
  77. </dl>
  78. </div>
  79. <h2 class="subsection-title">Methods</h2>
  80. <h3 class="name name-method" id="getTextureForReference" translate="no">.<a href="#getTextureForReference">getTextureForReference</a><span class="signature">( reference : <span class="param-type">RenderTarget</span> )</span><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  81. <div class="method">
  82. <div class="description">
  83. <p>This methods returns a texture for the given render target reference.</p>
  84. <p>To avoid rendering errors, <code>ViewportTextureNode</code> must use unique framebuffer textures
  85. for different render contexts.</p>
  86. </div>
  87. <table class="params">
  88. <tbody>
  89. <tr>
  90. <td class="name"><code>reference</code></td>
  91. <td class="description last"><p>The render target reference.<br/>Default is <code>null</code>.</p></td>
  92. </tr>
  93. </tbody>
  94. </table>
  95. <dl class="details">
  96. <dt class="tag-returns"><strong>Returns:</strong> The framebuffer texture.</dt>
  97. </dl>
  98. </div>
  99. <h2 class="subsection-title">Source</h2>
  100. <p>
  101. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/display/ViewportTextureNode.js" target="_blank" rel="noopener" translate="no">src/nodes/display/ViewportTextureNode.js</a>
  102. </p>
  103. </article>
  104. </section>
  105. <script src="../scripts/linenumber.js"></script>
  106. <script src="../scripts/page.js"></script>
  107. </body>
  108. </html>
粤ICP备19079148号