PixelationNode.html 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>PixelationNode - 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="TempNode.html">TempNode</a> → </p>
  13. <h1 translate="no">PixelationNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A inner node definition that implements the actual pixelation TSL code.</p></div>
  17. </header>
  18. <article>
  19. <div class="container-overview">
  20. <h2>Constructor</h2>
  21. <h3 class="name name-method" id="PixelationNode" translate="no">new <a href="#PixelationNode">PixelationNode</a><span class="signature">( textureNode : <span class="param-type"><a href="TextureNode.html">TextureNode</a></span>, depthNode : <span class="param-type"><a href="TextureNode.html">TextureNode</a></span>, normalNode : <span class="param-type"><a href="TextureNode.html">TextureNode</a></span>, pixelSize : <span class="param-type"><a href="Node.html">Node</a>.&lt;float></span>, normalEdgeStrength : <span class="param-type"><a href="Node.html">Node</a>.&lt;float></span>, depthEdgeStrength : <span class="param-type"><a href="Node.html">Node</a>.&lt;float></span> )</span> </h3>
  22. <div class="method">
  23. <div class="description">
  24. <p>Constructs a new pixelation node.</p>
  25. </div>
  26. <table class="params">
  27. <tbody>
  28. <tr>
  29. <td class="name">
  30. <strong>textureNode</strong>
  31. </td>
  32. <td class="description last">
  33. <p>The texture node that represents the beauty pass.</p>
  34. </td>
  35. </tr>
  36. <tr>
  37. <td class="name">
  38. <strong>depthNode</strong>
  39. </td>
  40. <td class="description last">
  41. <p>The texture that represents the beauty's depth.</p>
  42. </td>
  43. </tr>
  44. <tr>
  45. <td class="name">
  46. <strong>normalNode</strong>
  47. </td>
  48. <td class="description last">
  49. <p>The texture that represents the beauty's normals.</p>
  50. </td>
  51. </tr>
  52. <tr>
  53. <td class="name">
  54. <strong>pixelSize</strong>
  55. </td>
  56. <td class="description last">
  57. <p>The pixel size.</p>
  58. </td>
  59. </tr>
  60. <tr>
  61. <td class="name">
  62. <strong>normalEdgeStrength</strong>
  63. </td>
  64. <td class="description last">
  65. <p>The normal edge strength.</p>
  66. </td>
  67. </tr>
  68. <tr>
  69. <td class="name">
  70. <strong>depthEdgeStrength</strong>
  71. </td>
  72. <td class="description last">
  73. <p>The depth edge strength.</p>
  74. </td>
  75. </tr>
  76. </tbody>
  77. </table>
  78. </div>
  79. </div>
  80. <h2 class="subsection-title">Properties</h2>
  81. <div class="member">
  82. <h3 class="name" id="_resolution" translate="no">.<a href="#_resolution">_resolution</a><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;vec4></span> </h3>
  83. <div class="description">
  84. <p>Uniform node that represents the resolution.</p>
  85. </div>
  86. </div>
  87. <div class="member">
  88. <h3 class="name" id="depthEdgeStrength" translate="no">.<a href="#depthEdgeStrength">depthEdgeStrength</a><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;float></span> </h3>
  89. <div class="description">
  90. <p>The depth edge strength.</p>
  91. </div>
  92. </div>
  93. <div class="member">
  94. <h3 class="name" id="depthNode" translate="no">.<a href="#depthNode">depthNode</a><span class="type-signature"> : <a href="TextureNode.html">TextureNode</a></span> </h3>
  95. <div class="description">
  96. <p>The texture that represents the beauty's depth.</p>
  97. </div>
  98. </div>
  99. <div class="member">
  100. <h3 class="name" id="normalEdgeStrength" translate="no">.<a href="#normalEdgeStrength">normalEdgeStrength</a><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;float></span> </h3>
  101. <div class="description">
  102. <p>The pixel size.</p>
  103. </div>
  104. </div>
  105. <div class="member">
  106. <h3 class="name" id="normalNode" translate="no">.<a href="#normalNode">normalNode</a><span class="type-signature"> : <a href="TextureNode.html">TextureNode</a></span> </h3>
  107. <div class="description">
  108. <p>The texture that represents the beauty's normals.</p>
  109. </div>
  110. </div>
  111. <div class="member">
  112. <h3 class="name" id="pixelSize" translate="no">.<a href="#pixelSize">pixelSize</a><span class="type-signature"> : <a href="Node.html">Node</a>.&lt;float></span> </h3>
  113. <div class="description">
  114. <p>The pixel size.</p>
  115. </div>
  116. </div>
  117. <div class="member">
  118. <h3 class="name" id="textureNode" translate="no">.<a href="#textureNode">textureNode</a><span class="type-signature"> : <a href="TextureNode.html">TextureNode</a></span> </h3>
  119. <div class="description">
  120. <p>The texture node that represents the beauty pass.</p>
  121. </div>
  122. </div>
  123. <div class="member">
  124. <h3 class="name" id="updateBeforeType" translate="no">.<a href="#updateBeforeType">updateBeforeType</a><span class="type-signature"> : string</span> </h3>
  125. <div class="description">
  126. <p>The <code>updateBeforeType</code> is set to <code>NodeUpdateType.FRAME</code> since the node updates
  127. its internal uniforms once per frame in <code>updateBefore()</code>.</p>
  128. <p>Default is <code>'frame'</code>.</p>
  129. </div>
  130. <dl class="details">
  131. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#updateBeforeType">TempNode#updateBeforeType</a></dt>
  132. </dl>
  133. </div>
  134. <h2 class="subsection-title">Methods</h2>
  135. <h3 class="name name-method" id="setup" translate="no">.<a href="#setup">setup</a><span class="signature">( builder : <span class="param-type"><a href="NodeBuilder.html">NodeBuilder</a></span> )</span><span class="type-signature"> : ShaderCallNodeInternal</span> </h3>
  136. <div class="method">
  137. <div class="description">
  138. <p>This method is used to setup the effect's TSL code.</p>
  139. </div>
  140. <table class="params">
  141. <tbody>
  142. <tr>
  143. <td class="name">
  144. <strong>builder</strong>
  145. </td>
  146. <td class="description last">
  147. <p>The current node builder.</p>
  148. </td>
  149. </tr>
  150. </tbody>
  151. </table>
  152. <dl class="details">
  153. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#setup">TempNode#setup</a></dt>
  154. </dl>
  155. </div>
  156. <h3 class="name name-method" id="updateBefore" translate="no">.<a href="#updateBefore">updateBefore</a><span class="signature">( frame : <span class="param-type"><a href="NodeFrame.html">NodeFrame</a></span> )</span> </h3>
  157. <div class="method">
  158. <div class="description">
  159. <p>This method is used to update uniforms once per frame.</p>
  160. </div>
  161. <table class="params">
  162. <tbody>
  163. <tr>
  164. <td class="name">
  165. <strong>frame</strong>
  166. </td>
  167. <td class="description last">
  168. <p>The current node frame.</p>
  169. </td>
  170. </tr>
  171. </tbody>
  172. </table>
  173. <dl class="details">
  174. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#updateBefore">TempNode#updateBefore</a></dt>
  175. </dl>
  176. </div>
  177. <h2 class="subsection-title">Source</h2>
  178. <p>
  179. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/tsl/display/PixelationPassNode.js" target="_blank" rel="noopener" translate="no">examples/jsm/tsl/display/PixelationPassNode.js</a>
  180. </p>
  181. </article>
  182. </section>
  183. <script src="../scripts/linenumber.js"></script>
  184. <script src="../scripts/page.js"></script>
  185. </body>
  186. </html>
粤ICP备19079148号