PixelationPassNode.html 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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">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">Scene</span>, camera : <span class="param-type">Camera</span>, pixelSize : <span class="param-type">Node.&lt;float> | number</span>, normalEdgeStrength : <span class="param-type">Node.&lt;float> | number</span>, depthEdgeStrength : <span class="param-type">Node.&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"><code>scene</code></td>
  33. <td class="description last"><p>The scene to render.</p></td>
  34. </tr>
  35. <tr>
  36. <td class="name"><code>camera</code></td>
  37. <td class="description last"><p>The camera to render the scene with.</p></td>
  38. </tr>
  39. <tr>
  40. <td class="name"><code>pixelSize</code></td>
  41. <td class="description last"><p>The pixel size.<br/>Default is <code>6</code>.</p></td>
  42. </tr>
  43. <tr>
  44. <td class="name"><code>normalEdgeStrength</code></td>
  45. <td class="description last"><p>The normal edge strength.<br/>Default is <code>0.3</code>.</p></td>
  46. </tr>
  47. <tr>
  48. <td class="name"><code>depthEdgeStrength</code></td>
  49. <td class="description last"><p>The depth edge strength.<br/>Default is <code>0.4</code>.</p></td>
  50. </tr>
  51. </tbody>
  52. </table>
  53. </div>
  54. </div>
  55. <h2 class="subsection-title">Properties</h2>
  56. <div class="member">
  57. <h3 class="name" id="depthEdgeStrength" translate="no">.<a href="#depthEdgeStrength">depthEdgeStrength</a><span class="type-signature"> : number</span> </h3>
  58. <div class="description">
  59. <p>The depth edge strength.<br/>Default is <code>0.4</code>.</p>
  60. </div>
  61. </div>
  62. <div class="member">
  63. <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>
  64. <div class="description">
  65. <p>This flag can be used for type testing.<br/>Default is <code>true</code>.</p>
  66. </div>
  67. </div>
  68. <div class="member">
  69. <h3 class="name" id="normalEdgeStrength" translate="no">.<a href="#normalEdgeStrength">normalEdgeStrength</a><span class="type-signature"> : number</span> </h3>
  70. <div class="description">
  71. <p>The normal edge strength.<br/>Default is <code>0.3</code>.</p>
  72. </div>
  73. </div>
  74. <div class="member">
  75. <h3 class="name" id="pixelSize" translate="no">.<a href="#pixelSize">pixelSize</a><span class="type-signature"> : number</span> </h3>
  76. <div class="description">
  77. <p>The pixel size.<br/>Default is <code>6</code>.</p>
  78. </div>
  79. </div>
  80. <h2 class="subsection-title">Methods</h2>
  81. <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>
  82. <div class="method">
  83. <div class="description">
  84. <p>Sets the size of the pass.</p>
  85. </div>
  86. <table class="params">
  87. <tbody>
  88. <tr>
  89. <td class="name"><code>width</code></td>
  90. <td class="description last"><p>The width of the pass.</p></td>
  91. </tr>
  92. <tr>
  93. <td class="name"><code>height</code></td>
  94. <td class="description last"><p>The height of the pass.</p></td>
  95. </tr>
  96. </tbody>
  97. </table>
  98. <dl class="details">
  99. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="PassNode.html#setSize">PassNode#setSize</a></dt>
  100. </dl>
  101. </div>
  102. <h3 class="name name-method" id="setup" translate="no">.<a href="#setup">setup</a><span class="signature">( builder : <span class="param-type">NodeBuilder</span> )</span><span class="type-signature"> : <a href="PixelationNode.html">PixelationNode</a></span> </h3>
  103. <div class="method">
  104. <div class="description">
  105. <p>This method is used to setup the effect's TSL code.</p>
  106. </div>
  107. <table class="params">
  108. <tbody>
  109. <tr>
  110. <td class="name"><code>builder</code></td>
  111. <td class="description last"><p>The current node builder.</p></td>
  112. </tr>
  113. </tbody>
  114. </table>
  115. <dl class="details">
  116. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="PassNode.html#setup">PassNode#setup</a></dt>
  117. </dl>
  118. <dl class="details">
  119. <dt class="tag-returns"><strong>Returns:</strong> </dt>
  120. </dl>
  121. </div>
  122. <h2 class="subsection-title">Source</h2>
  123. <p>
  124. <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>
  125. </p>
  126. </article>
  127. </section>
  128. <script src="../scripts/linenumber.js"></script>
  129. <script src="../scripts/page.js"></script>
  130. </body>
  131. </html>
粤ICP备19079148号