CubeTexturePass.html 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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">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">PerspectiveCamera</span>, tCube : <span class="param-type">CubeTexture</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"><code>camera</code></td>
  38. <td class="description last"><p>The camera.</p></td>
  39. </tr>
  40. <tr>
  41. <td class="name"><code>tCube</code></td>
  42. <td class="description last"><p>The cube texture to render.</p></td>
  43. </tr>
  44. <tr>
  45. <td class="name"><code>opacity</code></td>
  46. <td class="description last"><p>The opacity.<br/>Default is <code>1</code>.</p></td>
  47. </tr>
  48. </tbody>
  49. </table>
  50. </div>
  51. </div>
  52. <h2 class="subsection-title">Properties</h2>
  53. <div class="member">
  54. <h3 class="name" id="camera" translate="no">.<a href="#camera">camera</a><span class="type-signature"> : <a href="PerspectiveCamera.html">PerspectiveCamera</a></span> </h3>
  55. <div class="description">
  56. <p>The camera.</p>
  57. </div>
  58. </div>
  59. <div class="member">
  60. <h3 class="name" id="needsSwap" translate="no">.<a href="#needsSwap">needsSwap</a><span class="type-signature"> : boolean</span> </h3>
  61. <div class="description">
  62. <p>Overwritten to disable the swap.<br/>Default is <code>false</code>.</p>
  63. </div>
  64. <dl class="details">
  65. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#needsSwap">Pass#needsSwap</a></dt>
  66. </dl>
  67. </div>
  68. <div class="member">
  69. <h3 class="name" id="opacity" translate="no">.<a href="#opacity">opacity</a><span class="type-signature"> : number</span> </h3>
  70. <div class="description">
  71. <p>The opacity.<br/>Default is <code>1</code>.</p>
  72. </div>
  73. </div>
  74. <div class="member">
  75. <h3 class="name" id="tCube" translate="no">.<a href="#tCube">tCube</a><span class="type-signature"> : <a href="CubeTexture.html">CubeTexture</a></span> </h3>
  76. <div class="description">
  77. <p>The cube texture to render.</p>
  78. </div>
  79. </div>
  80. <h2 class="subsection-title">Methods</h2>
  81. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  82. <div class="method">
  83. <div class="description">
  84. <p>Frees the GPU-related resources allocated by this instance. Call this
  85. method whenever the pass is no longer used in your app.</p>
  86. </div>
  87. <dl class="details">
  88. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#dispose">Pass#dispose</a></dt>
  89. </dl>
  90. </div>
  91. <h3 class="name name-method" id="render" translate="no">.<a href="#render">render</a><span class="signature">( renderer : <span class="param-type">WebGLRenderer</span>, writeBuffer : <span class="param-type">WebGLRenderTarget</span>, readBuffer : <span class="param-type">WebGLRenderTarget</span>, deltaTime : <span class="param-type">number</span>, maskActive : <span class="param-type">boolean</span> )</span> </h3>
  92. <div class="method">
  93. <div class="description">
  94. <p>Performs the cube texture pass.</p>
  95. </div>
  96. <table class="params">
  97. <tbody>
  98. <tr>
  99. <td class="name"><code>renderer</code></td>
  100. <td class="description last"><p>The renderer.</p></td>
  101. </tr>
  102. <tr>
  103. <td class="name"><code>writeBuffer</code></td>
  104. <td class="description last"><p>The write buffer. This buffer is intended as the rendering
  105. destination for the pass.</p></td>
  106. </tr>
  107. <tr>
  108. <td class="name"><code>readBuffer</code></td>
  109. <td class="description last"><p>The read buffer. The pass can access the result from the
  110. previous pass from this buffer.</p></td>
  111. </tr>
  112. <tr>
  113. <td class="name"><code>deltaTime</code></td>
  114. <td class="description last"><p>The delta time in seconds.</p></td>
  115. </tr>
  116. <tr>
  117. <td class="name"><code>maskActive</code></td>
  118. <td class="description last"><p>Whether masking is active or not.</p></td>
  119. </tr>
  120. </tbody>
  121. </table>
  122. <dl class="details">
  123. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#render">Pass#render</a></dt>
  124. </dl>
  125. </div>
  126. <h2 class="subsection-title">Source</h2>
  127. <p>
  128. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/postprocessing/CubeTexturePass.js" target="_blank" rel="noopener" translate="no">examples/jsm/postprocessing/CubeTexturePass.js</a>
  129. </p>
  130. </article>
  131. </section>
  132. <script src="../scripts/linenumber.js"></script>
  133. <script src="../scripts/page.js"></script>
  134. </body>
  135. </html>
粤ICP备19079148号