ViewportTextureNode.html 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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"><a href="Node.html">Node</a></span>, levelNode : <span class="param-type"><a href="Node.html">Node</a></span>, framebufferTexture : <span class="param-type"><a href="Texture.html">Texture</a></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">
  34. <strong>uvNode</strong>
  35. </td>
  36. <td class="description last">
  37. <p>The uv node.</p>
  38. <p>Default is <code>screenUV</code>.</p>
  39. </td>
  40. </tr>
  41. <tr>
  42. <td class="name">
  43. <strong>levelNode</strong>
  44. </td>
  45. <td class="description last">
  46. <p>The level node.</p>
  47. <p>Default is <code>null</code>.</p>
  48. </td>
  49. </tr>
  50. <tr>
  51. <td class="name">
  52. <strong>framebufferTexture</strong>
  53. </td>
  54. <td class="description last">
  55. <p>A framebuffer texture holding the viewport data. If not provided, a framebuffer texture is created automatically.</p>
  56. <p>Default is <code>null</code>.</p>
  57. </td>
  58. </tr>
  59. </tbody>
  60. </table>
  61. </div>
  62. </div>
  63. <h2 class="subsection-title">Properties</h2>
  64. <div class="member">
  65. <h3 class="name" id="defaultFramebuffer" translate="no">.<a href="#defaultFramebuffer">defaultFramebuffer</a><span class="type-signature"> : <a href="FramebufferTexture.html">FramebufferTexture</a></span> </h3>
  66. <div class="description">
  67. <p>The reference framebuffer texture. This is used to store the framebuffer texture
  68. for the current render target. If the render target changes, a new framebuffer texture
  69. is created automatically.</p>
  70. <p>Default is <code>null</code>.</p>
  71. </div>
  72. </div>
  73. <div class="member">
  74. <h3 class="name" id="generateMipmaps" translate="no">.<a href="#generateMipmaps">generateMipmaps</a><span class="type-signature"> : boolean</span> </h3>
  75. <div class="description">
  76. <p>Whether to generate mipmaps or not.</p>
  77. <p>Default is <code>false</code>.</p>
  78. </div>
  79. </div>
  80. <div class="member">
  81. <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>
  82. <div class="description">
  83. <p>This flag can be used for type testing.</p>
  84. <p>Default is <code>true</code>.</p>
  85. </div>
  86. </div>
  87. <div class="member">
  88. <h3 class="name" id="updateBeforeType" translate="no">.<a href="#updateBeforeType">updateBeforeType</a><span class="type-signature"> : string</span> </h3>
  89. <div class="description">
  90. <p>The <code>updateBeforeType</code> is set to <code>NodeUpdateType.FRAME</code> since the node renders the
  91. scene once per frame in its <a href="ViewportTextureNode.html#updateBefore">ViewportTextureNode#updateBefore</a> method.</p>
  92. <p>Default is <code>'frame'</code>.</p>
  93. </div>
  94. <dl class="details">
  95. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TextureNode.html#updateBeforeType">TextureNode#updateBeforeType</a></dt>
  96. </dl>
  97. </div>
  98. <h2 class="subsection-title">Methods</h2>
  99. <h3 class="name name-method" id="getTextureForReference" translate="no">.<a href="#getTextureForReference">getTextureForReference</a><span class="signature">( reference : <span class="param-type"><a href="RenderTarget.html">RenderTarget</a></span> )</span><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  100. <div class="method">
  101. <div class="description">
  102. <p>This methods returns a texture for the given render target reference.</p>
  103. <p>To avoid rendering errors, <code>ViewportTextureNode</code> must use unique framebuffer textures
  104. for different render contexts.</p>
  105. </div>
  106. <table class="params">
  107. <tbody>
  108. <tr>
  109. <td class="name">
  110. <strong>reference</strong>
  111. </td>
  112. <td class="description last">
  113. <p>The render target reference.</p>
  114. <p>Default is <code>null</code>.</p>
  115. </td>
  116. </tr>
  117. </tbody>
  118. </table>
  119. <dl class="details">
  120. <dt class="tag-returns"><strong>Returns:</strong> The framebuffer texture.</dt>
  121. </dl>
  122. </div>
  123. <h2 class="subsection-title">Source</h2>
  124. <p>
  125. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/display/ViewportTextureNode.js" translate="no" target="_blank" rel="noopener">src/nodes/display/ViewportTextureNode.js</a>
  126. </p>
  127. </article>
  128. </section>
  129. <script src="../scripts/linenumber.js"></script>
  130. <script src="../scripts/page.js"></script>
  131. </body>
  132. </html>
粤ICP备19079148号