PointShadowNode.html 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>PointShadowNode - 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="ShadowBaseNode.html">ShadowBaseNode</a> → <a href="ShadowNode.html">ShadowNode</a> → </p>
  13. <h1 translate="no">PointShadowNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Represents the shadow implementation for point light nodes.</p></div>
  17. </header>
  18. <article>
  19. <div class="container-overview">
  20. <h2>Constructor</h2>
  21. <h3 class="name name-method" id="PointShadowNode" translate="no">new <a href="#PointShadowNode">PointShadowNode</a><span class="signature">( light : <span class="param-type"><a href="PointLight.html">PointLight</a></span>, shadow : <span class="param-type"><a href="PointLightShadow.html">PointLightShadow</a></span> )</span> </h3>
  22. <div class="method">
  23. <div class="description">
  24. <p>Constructs a new point shadow node.</p>
  25. </div>
  26. <table class="params">
  27. <tbody>
  28. <tr>
  29. <td class="name">
  30. <strong>light</strong>
  31. </td>
  32. <td class="description last">
  33. <p>The shadow casting point light.</p>
  34. </td>
  35. </tr>
  36. <tr>
  37. <td class="name">
  38. <strong>shadow</strong>
  39. </td>
  40. <td class="description last">
  41. <p>An optional point light shadow.</p>
  42. <p>Default is <code>null</code>.</p>
  43. </td>
  44. </tr>
  45. </tbody>
  46. </table>
  47. </div>
  48. </div>
  49. <h2 class="subsection-title">Methods</h2>
  50. <h3 class="name name-method" id="getShadowFilterFn" translate="no">.<a href="#getShadowFilterFn">getShadowFilterFn</a><span class="signature">( type : <span class="param-type">number</span> )</span><span class="type-signature"> : function</span> </h3>
  51. <div class="method">
  52. <div class="description">
  53. <p>Overwrites the default implementation to return point light shadow specific
  54. filtering functions.</p>
  55. </div>
  56. <table class="params">
  57. <tbody>
  58. <tr>
  59. <td class="name">
  60. <strong>type</strong>
  61. </td>
  62. <td class="description last">
  63. <p>The shadow type.</p>
  64. </td>
  65. </tr>
  66. </tbody>
  67. </table>
  68. <dl class="details">
  69. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="ShadowNode.html#getShadowFilterFn">ShadowNode#getShadowFilterFn</a></dt>
  70. </dl>
  71. <dl class="details">
  72. <dt class="tag-returns"><strong>Returns:</strong> The filtering function.</dt>
  73. </dl>
  74. </div>
  75. <h3 class="name name-method" id="renderShadow" translate="no">.<a href="#renderShadow">renderShadow</a><span class="signature">( frame : <span class="param-type"><a href="NodeFrame.html">NodeFrame</a></span> )</span> </h3>
  76. <div class="method">
  77. <div class="description">
  78. <p>Overwrites the default implementation with point light specific
  79. rendering code.</p>
  80. </div>
  81. <table class="params">
  82. <tbody>
  83. <tr>
  84. <td class="name">
  85. <strong>frame</strong>
  86. </td>
  87. <td class="description last">
  88. <p>A reference to the current node frame.</p>
  89. </td>
  90. </tr>
  91. </tbody>
  92. </table>
  93. <dl class="details">
  94. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="ShadowNode.html#renderShadow">ShadowNode#renderShadow</a></dt>
  95. </dl>
  96. </div>
  97. <h3 class="name name-method" id="setupRenderTarget" translate="no">.<a href="#setupRenderTarget">setupRenderTarget</a><span class="signature">( shadow : <span class="param-type"><a href="LightShadow.html">LightShadow</a></span>, builder : <span class="param-type"><a href="NodeBuilder.html">NodeBuilder</a></span> )</span><span class="type-signature"> : Object</span> </h3>
  98. <div class="method">
  99. <div class="description">
  100. <p>Overwrites the default implementation to create a CubeRenderTarget with CubeDepthTexture.</p>
  101. </div>
  102. <table class="params">
  103. <tbody>
  104. <tr>
  105. <td class="name">
  106. <strong>shadow</strong>
  107. </td>
  108. <td class="description last">
  109. <p>The light shadow object.</p>
  110. </td>
  111. </tr>
  112. <tr>
  113. <td class="name">
  114. <strong>builder</strong>
  115. </td>
  116. <td class="description last">
  117. <p>A reference to the current node builder.</p>
  118. </td>
  119. </tr>
  120. </tbody>
  121. </table>
  122. <dl class="details">
  123. <dt class="tag-returns"><strong>Returns:</strong> An object containing the shadow map and depth texture.</dt>
  124. </dl>
  125. </div>
  126. <h3 class="name name-method" id="setupShadowCoord" translate="no">.<a href="#setupShadowCoord">setupShadowCoord</a><span class="signature">( builder : <span class="param-type"><a href="NodeBuilder.html">NodeBuilder</a></span>, shadowPosition : <span class="param-type"><a href="Node.html">Node</a>.&lt;vec3></span> )</span><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;vec3></span> </h3>
  127. <div class="method">
  128. <div class="description">
  129. <p>Overwrites the default implementation so the unaltered shadow position is used.</p>
  130. </div>
  131. <table class="params">
  132. <tbody>
  133. <tr>
  134. <td class="name">
  135. <strong>builder</strong>
  136. </td>
  137. <td class="description last">
  138. <p>A reference to the current node builder.</p>
  139. </td>
  140. </tr>
  141. <tr>
  142. <td class="name">
  143. <strong>shadowPosition</strong>
  144. </td>
  145. <td class="description last">
  146. <p>A node representing the shadow position.</p>
  147. </td>
  148. </tr>
  149. </tbody>
  150. </table>
  151. <dl class="details">
  152. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="ShadowNode.html#setupShadowCoord">ShadowNode#setupShadowCoord</a></dt>
  153. </dl>
  154. <dl class="details">
  155. <dt class="tag-returns"><strong>Returns:</strong> The shadow coordinates.</dt>
  156. </dl>
  157. </div>
  158. <h3 class="name name-method" id="setupShadowFilter" translate="no">.<a href="#setupShadowFilter">setupShadowFilter</a><span class="signature">( builder : <span class="param-type"><a href="NodeBuilder.html">NodeBuilder</a></span>, inputs : <span class="param-type">Object</span> )</span><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;float></span> </h3>
  159. <div class="method">
  160. <div class="description">
  161. <p>Overwrites the default implementation to only use point light specific
  162. shadow filter functions.</p>
  163. </div>
  164. <table class="params">
  165. <tbody>
  166. <tr>
  167. <td class="name">
  168. <strong>builder</strong>
  169. </td>
  170. <td class="description last">
  171. <p>A reference to the current node builder.</p>
  172. </td>
  173. </tr>
  174. <tr>
  175. <td class="name">
  176. <strong>inputs</strong>
  177. </td>
  178. <td class="description last">
  179. <p>A configuration object that defines the shadow filtering.</p>
  180. <table class="params">
  181. <tbody>
  182. <tr>
  183. <td class="name">
  184. <strong>filterFn</strong>
  185. </td>
  186. <td class="description last">
  187. <p>This function defines the filtering type of the shadow map e.g. PCF.</p>
  188. </td>
  189. </tr>
  190. <tr>
  191. <td class="name">
  192. <strong>depthTexture</strong>
  193. </td>
  194. <td class="description last">
  195. <p>A reference to the shadow map's depth texture.</p>
  196. </td>
  197. </tr>
  198. <tr>
  199. <td class="name">
  200. <strong>shadowCoord</strong>
  201. </td>
  202. <td class="description last">
  203. <p>Shadow coordinates which are used to sample from the shadow map.</p>
  204. </td>
  205. </tr>
  206. <tr>
  207. <td class="name">
  208. <strong>shadow</strong>
  209. </td>
  210. <td class="description last">
  211. <p>The light shadow.</p>
  212. </td>
  213. </tr>
  214. </tbody>
  215. </table>
  216. </td>
  217. </tr>
  218. </tbody>
  219. </table>
  220. <dl class="details">
  221. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="ShadowNode.html#setupShadowFilter">ShadowNode#setupShadowFilter</a></dt>
  222. </dl>
  223. <dl class="details">
  224. <dt class="tag-returns"><strong>Returns:</strong> The result node of the shadow filtering.</dt>
  225. </dl>
  226. </div>
  227. <h2 class="subsection-title">Source</h2>
  228. <p>
  229. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/lighting/PointShadowNode.js" translate="no" target="_blank" rel="noopener">src/nodes/lighting/PointShadowNode.js</a>
  230. </p>
  231. </article>
  232. </section>
  233. <script src="../scripts/linenumber.js"></script>
  234. <script src="../scripts/page.js"></script>
  235. </body>
  236. </html>
粤ICP备19079148号