ReflectorNode.html 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>ReflectorNode - 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">ReflectorNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>This node can be used to implement mirror-like flat reflective surfaces.</p></div>
  17. <h2>Code Example</h2>
  18. <div translate="no"><pre><code class="language-js">const groundReflector = reflector();
  19. material.colorNode = groundReflector;
  20. const plane = new Mesh( geometry, material );
  21. plane.add( groundReflector.target );
  22. </code></pre></div>
  23. </header>
  24. <article>
  25. <div class="container-overview">
  26. <h2>Constructor</h2>
  27. <h3 class="name name-method" id="ReflectorNode" translate="no">new <a href="#ReflectorNode">ReflectorNode</a><span class="signature">( parameters : <span class="param-type">Object</span> )</span> </h3>
  28. <div class="method">
  29. <div class="description">
  30. <p>Constructs a new reflector node.</p>
  31. </div>
  32. <table class="params">
  33. <tbody>
  34. <tr>
  35. <td class="name">
  36. <strong>parameters</strong>
  37. </td>
  38. <td class="description last">
  39. <p>An object holding configuration parameters.</p>
  40. <p>Default is <code>{}</code>.</p>
  41. <table class="params">
  42. <tbody>
  43. <tr>
  44. <td class="name">
  45. <strong>target</strong>
  46. </td>
  47. <td class="description last">
  48. <p>The 3D object the reflector is linked to.</p>
  49. <p>Default is <code>new Object3D()</code>.</p>
  50. </td>
  51. </tr>
  52. <tr>
  53. <td class="name">
  54. <strong>resolutionScale</strong>
  55. </td>
  56. <td class="description last">
  57. <p>The resolution scale.</p>
  58. <p>Default is <code>1</code>.</p>
  59. </td>
  60. </tr>
  61. <tr>
  62. <td class="name">
  63. <strong>generateMipmaps</strong>
  64. </td>
  65. <td class="description last">
  66. <p>Whether mipmaps should be generated or not.</p>
  67. <p>Default is <code>false</code>.</p>
  68. </td>
  69. </tr>
  70. <tr>
  71. <td class="name">
  72. <strong>bounces</strong>
  73. </td>
  74. <td class="description last">
  75. <p>Whether reflectors can render other reflector nodes or not.</p>
  76. <p>Default is <code>true</code>.</p>
  77. </td>
  78. </tr>
  79. <tr>
  80. <td class="name">
  81. <strong>depth</strong>
  82. </td>
  83. <td class="description last">
  84. <p>Whether depth data should be generated or not.</p>
  85. <p>Default is <code>false</code>.</p>
  86. </td>
  87. </tr>
  88. <tr>
  89. <td class="name">
  90. <strong>samples</strong>
  91. </td>
  92. <td class="description last">
  93. <p>Anti-Aliasing samples of the internal render-target.</p>
  94. </td>
  95. </tr>
  96. <tr>
  97. <td class="name">
  98. <strong>defaultTexture</strong>
  99. </td>
  100. <td class="description last">
  101. <p>The default texture node.</p>
  102. </td>
  103. </tr>
  104. <tr>
  105. <td class="name">
  106. <strong>reflector</strong>
  107. </td>
  108. <td class="description last">
  109. <p>The reflector base node.</p>
  110. </td>
  111. </tr>
  112. </tbody>
  113. </table>
  114. </td>
  115. </tr>
  116. </tbody>
  117. </table>
  118. </div>
  119. </div>
  120. <h2 class="subsection-title">Properties</h2>
  121. <div class="member">
  122. <h3 class="name" id="reflector" translate="no">.<a href="#reflector">reflector</a><span class="type-signature"> : <a href="ReflectorBaseNode.html">ReflectorBaseNode</a></span> </h3>
  123. <div class="description">
  124. <p>A reference to the internal reflector node.</p>
  125. </div>
  126. </div>
  127. <div class="member">
  128. <h3 class="name" id="target" translate="no">.<a href="#target">target</a><span class="type-signature"> : <a href="Object3D.html">Object3D</a></span> </h3>
  129. <div class="description">
  130. <p>A reference to 3D object the reflector is linked to.</p>
  131. </div>
  132. </div>
  133. <h2 class="subsection-title">Methods</h2>
  134. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  135. <div class="method">
  136. <div class="description">
  137. <p>Frees internal resources. Should be called when the node is no longer in use.</p>
  138. </div>
  139. <dl class="details">
  140. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TextureNode.html#dispose">TextureNode#dispose</a></dt>
  141. </dl>
  142. </div>
  143. <h3 class="name name-method" id="getDepthNode" translate="no">.<a href="#getDepthNode">getDepthNode</a><span class="signature">()</span><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
  144. <div class="method">
  145. <div class="description">
  146. <p>Returns a node representing the mirror's depth. That can be used
  147. to implement more advanced reflection effects like distance attenuation.</p>
  148. </div>
  149. <dl class="details">
  150. <dt class="tag-returns"><strong>Returns:</strong> The depth node.</dt>
  151. </dl>
  152. </div>
  153. <h2 class="subsection-title">Source</h2>
  154. <p>
  155. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/utils/ReflectorNode.js" translate="no" target="_blank" rel="noopener">src/nodes/utils/ReflectorNode.js</a>
  156. </p>
  157. </article>
  158. </section>
  159. <script src="../scripts/linenumber.js"></script>
  160. <script src="../scripts/page.js"></script>
  161. </body>
  162. </html>
粤ICP备19079148号