ReflectorForSSRPass.html 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>ReflectorForSSRPass - 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="Object3D.html">Object3D</a> → <a href="Mesh.html">Mesh</a> → </p>
  13. <h1 translate="no">ReflectorForSSRPass</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A special version of <a href="Reflector.html">Reflector</a> for usage with <a href="SSRPass.html">SSRPass</a>.</p></div>
  17. </header>
  18. <article>
  19. <h2 class="subsection-title">Import</h2>
  20. <p><span translate="no">ReflectorForSSRPass</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>
  21. <pre><code class="language-js">import { ReflectorForSSRPass } from 'three/addons/objects/ReflectorForSSRPass.js';</code></pre>
  22. <div class="container-overview">
  23. <h2>Constructor</h2>
  24. <h3 class="name name-method" id="ReflectorForSSRPass" translate="no">new <a href="#ReflectorForSSRPass">ReflectorForSSRPass</a><span class="signature">( geometry : <span class="param-type"><a href="BufferGeometry.html">BufferGeometry</a></span>, options : <span class="param-type"><a href="ReflectorForSSRPass.html#~Options">ReflectorForSSRPass~Options</a></span> )</span> </h3>
  25. <div class="method">
  26. <div class="description">
  27. <p>Constructs a new reflector.</p>
  28. </div>
  29. <table class="params">
  30. <tbody>
  31. <tr>
  32. <td class="name">
  33. <strong>geometry</strong>
  34. </td>
  35. <td class="description last">
  36. <p>The reflector's geometry.</p>
  37. </td>
  38. </tr>
  39. <tr>
  40. <td class="name">
  41. <strong>options</strong>
  42. </td>
  43. <td class="description last">
  44. <p>The configuration options.</p>
  45. </td>
  46. </tr>
  47. </tbody>
  48. </table>
  49. </div>
  50. </div>
  51. <h2 class="subsection-title">Methods</h2>
  52. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  53. <div class="method">
  54. <div class="description">
  55. <p>Frees the GPU-related resources allocated by this instance. Call this
  56. method whenever this instance is no longer used in your app.</p>
  57. </div>
  58. </div>
  59. <h3 class="name name-method" id="getRenderTarget" translate="no">.<a href="#getRenderTarget">getRenderTarget</a><span class="signature">()</span><span class="type-signature"> : <a href="WebGLRenderTarget.html">WebGLRenderTarget</a></span> </h3>
  60. <div class="method">
  61. <div class="description">
  62. <p>Returns the reflector's internal render target.</p>
  63. </div>
  64. <dl class="details">
  65. <dt class="tag-returns"><strong>Returns:</strong> The internal render target</dt>
  66. </dl>
  67. </div>
  68. <h2 class="subsection-title">Type Definitions</h2>
  69. <div class="member">
  70. <h3 class="name" id="~Options" translate="no">.<a href="#~Options">Options</a> </h3>
  71. <div class="description">
  72. <p>Constructor options of <code>ReflectorForSSRPass</code>.</p>
  73. </div>
  74. <table class="props">
  75. <tbody>
  76. <tr>
  77. <td class="name">
  78. <strong>color</strong>
  79. <br>
  80. <span class="param-type">number</span>
  81. |
  82. <span class="param-type"><a href="Color.html">Color</a></span>
  83. |
  84. <span class="param-type">string</span>
  85. </td>
  86. <td class="description last">
  87. <p>The reflector's color.</p>
  88. <p>Default is <code>0x7F7F7F</code>.</p>
  89. </td>
  90. </tr>
  91. <tr>
  92. <td class="name">
  93. <strong>textureWidth</strong>
  94. <br>
  95. <span class="param-type">number</span>
  96. </td>
  97. <td class="description last">
  98. <p>The texture width. A higher value results in more clear reflections but is also more expensive.</p>
  99. <p>Default is <code>512</code>.</p>
  100. </td>
  101. </tr>
  102. <tr>
  103. <td class="name">
  104. <strong>textureHeight</strong>
  105. <br>
  106. <span class="param-type">number</span>
  107. </td>
  108. <td class="description last">
  109. <p>The texture height. A higher value results in more clear reflections but is also more expensive.</p>
  110. <p>Default is <code>512</code>.</p>
  111. </td>
  112. </tr>
  113. <tr>
  114. <td class="name">
  115. <strong>clipBias</strong>
  116. <br>
  117. <span class="param-type">number</span>
  118. </td>
  119. <td class="description last">
  120. <p>The clip bias.</p>
  121. <p>Default is <code>0</code>.</p>
  122. </td>
  123. </tr>
  124. <tr>
  125. <td class="name">
  126. <strong>shader</strong>
  127. <br>
  128. <span class="param-type">Object</span>
  129. </td>
  130. <td class="description last">
  131. <p>Can be used to pass in a custom shader that defines how the reflective view is projected onto the reflector's geometry.</p>
  132. </td>
  133. </tr>
  134. <tr>
  135. <td class="name">
  136. <strong>useDepthTexture</strong>
  137. <br>
  138. <span class="param-type">boolean</span>
  139. </td>
  140. <td class="description last">
  141. <p>Whether to store depth values in a texture or not.</p>
  142. <p>Default is <code>true</code>.</p>
  143. </td>
  144. </tr>
  145. <tr>
  146. <td class="name">
  147. <strong>resolution</strong>
  148. <br>
  149. <span class="param-type"><a href="Vector2.html">Vector2</a></span>
  150. </td>
  151. <td class="description last">
  152. <p>Resolution for the Reflector Pass.</p>
  153. </td>
  154. </tr>
  155. </tbody>
  156. </table>
  157. </div>
  158. <h2 class="subsection-title">Source</h2>
  159. <p>
  160. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/objects/ReflectorForSSRPass.js" translate="no" target="_blank" rel="noopener">examples/jsm/objects/ReflectorForSSRPass.js</a>
  161. </p>
  162. </article>
  163. </section>
  164. <script src="../scripts/linenumber.js"></script>
  165. <script src="../scripts/page.js"></script>
  166. </body>
  167. </html>
粤ICP备19079148号