1
0

PixelationPassNode.html 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>PixelationPassNode - 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> → <a href="PassNode.html">PassNode</a> → </p>
  13. <h1 translate="no">PixelationPassNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A special render pass node that renders the scene with a pixelation effect.</p></div>
  17. </header>
  18. <article>
  19. <h2 class="subsection-title">Import</h2>
  20. <p><span translate="no">PixelationPassNode</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 { pixelationPass } from 'three/addons/tsl/display/PixelationPassNode.js';</code></pre>
  22. <div class="container-overview">
  23. <h2>Constructor</h2>
  24. <h3 class="name name-method" id="PixelationPassNode" translate="no">new <a href="#PixelationPassNode">PixelationPassNode</a><span class="signature">( scene : <span class="param-type"><a href="Scene.html">Scene</a></span>, camera : <span class="param-type"><a href="Camera.html">Camera</a></span>, pixelSize : <span class="param-type"><a href="Node.html">Node</a>.&lt;float> | number</span>, normalEdgeStrength : <span class="param-type"><a href="Node.html">Node</a>.&lt;float> | number</span>, depthEdgeStrength : <span class="param-type"><a href="Node.html">Node</a>.&lt;float> | number</span> )</span> </h3>
  25. <div class="method">
  26. <div class="description">
  27. <p>Constructs a new pixelation pass node.</p>
  28. </div>
  29. <table class="params">
  30. <tbody>
  31. <tr>
  32. <td class="name">
  33. <strong>scene</strong>
  34. </td>
  35. <td class="description last">
  36. <p>The scene to render.</p>
  37. </td>
  38. </tr>
  39. <tr>
  40. <td class="name">
  41. <strong>camera</strong>
  42. </td>
  43. <td class="description last">
  44. <p>The camera to render the scene with.</p>
  45. </td>
  46. </tr>
  47. <tr>
  48. <td class="name">
  49. <strong>pixelSize</strong>
  50. </td>
  51. <td class="description last">
  52. <p>The pixel size.</p>
  53. <p>Default is <code>6</code>.</p>
  54. </td>
  55. </tr>
  56. <tr>
  57. <td class="name">
  58. <strong>normalEdgeStrength</strong>
  59. </td>
  60. <td class="description last">
  61. <p>The normal edge strength.</p>
  62. <p>Default is <code>0.3</code>.</p>
  63. </td>
  64. </tr>
  65. <tr>
  66. <td class="name">
  67. <strong>depthEdgeStrength</strong>
  68. </td>
  69. <td class="description last">
  70. <p>The depth edge strength.</p>
  71. <p>Default is <code>0.4</code>.</p>
  72. </td>
  73. </tr>
  74. </tbody>
  75. </table>
  76. </div>
  77. </div>
  78. <h2 class="subsection-title">Properties</h2>
  79. <div class="member">
  80. <h3 class="name" id="depthEdgeStrength" translate="no">.<a href="#depthEdgeStrength">depthEdgeStrength</a><span class="type-signature"> : number</span> </h3>
  81. <div class="description">
  82. <p>The depth edge strength.</p>
  83. <p>Default is <code>0.4</code>.</p>
  84. </div>
  85. </div>
  86. <div class="member">
  87. <h3 class="name" id="isPixelationPassNode" translate="no">.<a href="#isPixelationPassNode">isPixelationPassNode</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  88. <div class="description">
  89. <p>This flag can be used for type testing.</p>
  90. <p>Default is <code>true</code>.</p>
  91. </div>
  92. </div>
  93. <div class="member">
  94. <h3 class="name" id="normalEdgeStrength" translate="no">.<a href="#normalEdgeStrength">normalEdgeStrength</a><span class="type-signature"> : number</span> </h3>
  95. <div class="description">
  96. <p>The normal edge strength.</p>
  97. <p>Default is <code>0.3</code>.</p>
  98. </div>
  99. </div>
  100. <div class="member">
  101. <h3 class="name" id="pixelSize" translate="no">.<a href="#pixelSize">pixelSize</a><span class="type-signature"> : number</span> </h3>
  102. <div class="description">
  103. <p>The pixel size.</p>
  104. <p>Default is <code>6</code>.</p>
  105. </div>
  106. </div>
  107. <h2 class="subsection-title">Methods</h2>
  108. <h3 class="name name-method" id="setSize" translate="no">.<a href="#setSize">setSize</a><span class="signature">( width : <span class="param-type">number</span>, height : <span class="param-type">number</span> )</span> </h3>
  109. <div class="method">
  110. <div class="description">
  111. <p>Sets the size of the pass.</p>
  112. </div>
  113. <table class="params">
  114. <tbody>
  115. <tr>
  116. <td class="name">
  117. <strong>width</strong>
  118. </td>
  119. <td class="description last">
  120. <p>The width of the pass.</p>
  121. </td>
  122. </tr>
  123. <tr>
  124. <td class="name">
  125. <strong>height</strong>
  126. </td>
  127. <td class="description last">
  128. <p>The height of the pass.</p>
  129. </td>
  130. </tr>
  131. </tbody>
  132. </table>
  133. <dl class="details">
  134. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="PassNode.html#setSize">PassNode#setSize</a></dt>
  135. </dl>
  136. </div>
  137. <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"> : <a href="PixelationNode.html">PixelationNode</a></span> </h3>
  138. <div class="method">
  139. <div class="description">
  140. <p>This method is used to setup the effect's TSL code.</p>
  141. </div>
  142. <table class="params">
  143. <tbody>
  144. <tr>
  145. <td class="name">
  146. <strong>builder</strong>
  147. </td>
  148. <td class="description last">
  149. <p>The current node builder.</p>
  150. </td>
  151. </tr>
  152. </tbody>
  153. </table>
  154. <dl class="details">
  155. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="PassNode.html#setup">PassNode#setup</a></dt>
  156. </dl>
  157. </div>
  158. <h2 class="subsection-title">Source</h2>
  159. <p>
  160. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/tsl/display/PixelationPassNode.js" translate="no" target="_blank" rel="noopener">examples/jsm/tsl/display/PixelationPassNode.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号