CubeTexturePass.html 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>CubeTexturePass - 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="Pass.html">Pass</a> → </p>
  13. <h1 translate="no">CubeTexturePass</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>This pass can be used to render a cube texture over the entire screen.</p></div>
  17. <h2>Code Example</h2>
  18. <div translate="no"><pre><code class="language-js">const cubeMap = new THREE.CubeTextureLoader().load( urls );
  19. const cubeTexturePass = new CubeTexturePass( camera, cubemap );
  20. composer.addPass( cubeTexturePass );
  21. </code></pre></div>
  22. </header>
  23. <article>
  24. <h2 class="subsection-title">Import</h2>
  25. <p><span translate="no">CubeTexturePass</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank" rel="noopener">Installation#Addons</a>.</p>
  26. <pre><code class="language-js">import { CubeTexturePass } from 'three/addons/postprocessing/CubeTexturePass.js';</code></pre>
  27. <div class="container-overview">
  28. <h2>Constructor</h2>
  29. <h3 class="name name-method" id="CubeTexturePass" translate="no">new <a href="#CubeTexturePass">CubeTexturePass</a><span class="signature">( camera : <span class="param-type"><a href="PerspectiveCamera.html">PerspectiveCamera</a></span>, tCube : <span class="param-type"><a href="CubeTexture.html">CubeTexture</a></span>, opacity : <span class="param-type">number</span> )</span> </h3>
  30. <div class="method">
  31. <div class="description">
  32. <p>Constructs a new cube texture pass.</p>
  33. </div>
  34. <table class="params">
  35. <tbody>
  36. <tr>
  37. <td class="name">
  38. <strong>camera</strong>
  39. </td>
  40. <td class="description last">
  41. <p>The camera.</p>
  42. </td>
  43. </tr>
  44. <tr>
  45. <td class="name">
  46. <strong>tCube</strong>
  47. </td>
  48. <td class="description last">
  49. <p>The cube texture to render.</p>
  50. </td>
  51. </tr>
  52. <tr>
  53. <td class="name">
  54. <strong>opacity</strong>
  55. </td>
  56. <td class="description last">
  57. <p>The opacity.</p>
  58. <p>Default is <code>1</code>.</p>
  59. </td>
  60. </tr>
  61. </tbody>
  62. </table>
  63. </div>
  64. </div>
  65. <h2 class="subsection-title">Properties</h2>
  66. <div class="member">
  67. <h3 class="name" id="camera" translate="no">.<a href="#camera">camera</a><span class="type-signature"> : <a href="PerspectiveCamera.html">PerspectiveCamera</a></span> </h3>
  68. <div class="description">
  69. <p>The camera.</p>
  70. </div>
  71. </div>
  72. <div class="member">
  73. <h3 class="name" id="needsSwap" translate="no">.<a href="#needsSwap">needsSwap</a><span class="type-signature"> : boolean</span> </h3>
  74. <div class="description">
  75. <p>Overwritten to disable the swap.</p>
  76. <p>Default is <code>false</code>.</p>
  77. </div>
  78. <dl class="details">
  79. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#needsSwap">Pass#needsSwap</a></dt>
  80. </dl>
  81. </div>
  82. <div class="member">
  83. <h3 class="name" id="opacity" translate="no">.<a href="#opacity">opacity</a><span class="type-signature"> : number</span> </h3>
  84. <div class="description">
  85. <p>The opacity.</p>
  86. <p>Default is <code>1</code>.</p>
  87. </div>
  88. </div>
  89. <div class="member">
  90. <h3 class="name" id="tCube" translate="no">.<a href="#tCube">tCube</a><span class="type-signature"> : <a href="CubeTexture.html">CubeTexture</a></span> </h3>
  91. <div class="description">
  92. <p>The cube texture to render.</p>
  93. </div>
  94. </div>
  95. <h2 class="subsection-title">Methods</h2>
  96. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  97. <div class="method">
  98. <div class="description">
  99. <p>Frees the GPU-related resources allocated by this instance. Call this
  100. method whenever the pass is no longer used in your app.</p>
  101. </div>
  102. <dl class="details">
  103. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#dispose">Pass#dispose</a></dt>
  104. </dl>
  105. </div>
  106. <h3 class="name name-method" id="render" translate="no">.<a href="#render">render</a><span class="signature">( renderer : <span class="param-type"><a href="WebGLRenderer.html">WebGLRenderer</a></span>, writeBuffer : <span class="param-type"><a href="WebGLRenderTarget.html">WebGLRenderTarget</a></span>, readBuffer : <span class="param-type"><a href="WebGLRenderTarget.html">WebGLRenderTarget</a></span>, deltaTime : <span class="param-type">number</span>, maskActive : <span class="param-type">boolean</span> )</span> </h3>
  107. <div class="method">
  108. <div class="description">
  109. <p>Performs the cube texture pass.</p>
  110. </div>
  111. <table class="params">
  112. <tbody>
  113. <tr>
  114. <td class="name">
  115. <strong>renderer</strong>
  116. </td>
  117. <td class="description last">
  118. <p>The renderer.</p>
  119. </td>
  120. </tr>
  121. <tr>
  122. <td class="name">
  123. <strong>writeBuffer</strong>
  124. </td>
  125. <td class="description last">
  126. <p>The write buffer. This buffer is intended as the rendering
  127. destination for the pass.</p>
  128. </td>
  129. </tr>
  130. <tr>
  131. <td class="name">
  132. <strong>readBuffer</strong>
  133. </td>
  134. <td class="description last">
  135. <p>The read buffer. The pass can access the result from the
  136. previous pass from this buffer.</p>
  137. </td>
  138. </tr>
  139. <tr>
  140. <td class="name">
  141. <strong>deltaTime</strong>
  142. </td>
  143. <td class="description last">
  144. <p>The delta time in seconds.</p>
  145. </td>
  146. </tr>
  147. <tr>
  148. <td class="name">
  149. <strong>maskActive</strong>
  150. </td>
  151. <td class="description last">
  152. <p>Whether masking is active or not.</p>
  153. </td>
  154. </tr>
  155. </tbody>
  156. </table>
  157. <dl class="details">
  158. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#render">Pass#render</a></dt>
  159. </dl>
  160. </div>
  161. <h2 class="subsection-title">Source</h2>
  162. <p>
  163. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/postprocessing/CubeTexturePass.js" translate="no" target="_blank" rel="noopener">examples/jsm/postprocessing/CubeTexturePass.js</a>
  164. </p>
  165. </article>
  166. </section>
  167. <script src="../scripts/linenumber.js"></script>
  168. <script src="../scripts/page.js"></script>
  169. </body>
  170. </html>
粤ICP备19079148号