RenderPixelatedPass.html 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>RenderPixelatedPass - 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="Pass.html">Pass</a> → </p>
  13. <h1 translate="no">RenderPixelatedPass</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A special type of render pass that produces a pixelated beauty pass.</p></div>
  17. <h2>Code Example</h2>
  18. <div translate="no"><pre><code class="language-js">const renderPixelatedPass = new RenderPixelatedPass( 6, scene, camera );
  19. composer.addPass( renderPixelatedPass );
  20. </code></pre></div>
  21. </header>
  22. <article>
  23. <h2 class="subsection-title">Import</h2>
  24. <p><span translate="no">RenderPixelatedPass</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank">Installation#Addons</a>.</p>
  25. <pre><code class="language-js">import { RenderPixelatedPass } from 'three/addons/postprocessing/RenderPixelatedPass.js';</code></pre>
  26. <div class="container-overview">
  27. <h2>Constructor</h2>
  28. <h3 class="name name-method" id="RenderPixelatedPass" translate="no">new <a href="#RenderPixelatedPass">RenderPixelatedPass</a><span class="signature">( pixelSize : <span class="param-type">number</span>, scene : <span class="param-type">Scene</span>, camera : <span class="param-type">Camera</span>, options : <span class="param-type">Object</span> )</span> </h3>
  29. <div class="method">
  30. <div class="description">
  31. <p>Constructs a new render pixelated pass.</p>
  32. </div>
  33. <table class="params">
  34. <tbody>
  35. <tr>
  36. <td class="name"><code>pixelSize</code></td>
  37. <td class="description last"><p>The effect's pixel size.</p></td>
  38. </tr>
  39. <tr>
  40. <td class="name"><code>scene</code></td>
  41. <td class="description last"><p>The scene to render.</p></td>
  42. </tr>
  43. <tr>
  44. <td class="name"><code>camera</code></td>
  45. <td class="description last"><p>The camera.</p></td>
  46. </tr>
  47. <tr>
  48. <td class="name"><code>options</code></td>
  49. <td class="description last"><p>The pass options.</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="camera" translate="no">.<a href="#camera">camera</a><span class="type-signature"> : <a href="Camera.html">Camera</a></span> </h3>
  58. <div class="description">
  59. <p>The camera.</p>
  60. </div>
  61. </div>
  62. <div class="member">
  63. <h3 class="name" id="depthEdgeStrength" translate="no">.<a href="#depthEdgeStrength">depthEdgeStrength</a><span class="type-signature"> : number</span> </h3>
  64. <div class="description">
  65. <p>The normal edge strength.<br/>Default is <code>0.4</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 effect's pixel size.</p>
  78. </div>
  79. </div>
  80. <div class="member">
  81. <h3 class="name" id="pixelatedMaterial" translate="no">.<a href="#pixelatedMaterial">pixelatedMaterial</a><span class="type-signature"> : <a href="ShaderMaterial.html">ShaderMaterial</a></span> </h3>
  82. <div class="description">
  83. <p>The pixelated material.</p>
  84. </div>
  85. </div>
  86. <div class="member">
  87. <h3 class="name" id="scene" translate="no">.<a href="#scene">scene</a><span class="type-signature"> : <a href="Scene.html">Scene</a></span> </h3>
  88. <div class="description">
  89. <p>The scene to render.</p>
  90. </div>
  91. </div>
  92. <h2 class="subsection-title">Methods</h2>
  93. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  94. <div class="method">
  95. <div class="description">
  96. <p>Frees the GPU-related resources allocated by this instance. Call this
  97. method whenever the pass is no longer used in your app.</p>
  98. </div>
  99. <dl class="details">
  100. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#dispose">Pass#dispose</a></dt>
  101. </dl>
  102. </div>
  103. <h3 class="name name-method" id="render" translate="no">.<a href="#render">render</a><span class="signature">( renderer : <span class="param-type">WebGLRenderer</span>, writeBuffer : <span class="param-type">WebGLRenderTarget</span>, readBuffer : <span class="param-type">WebGLRenderTarget</span>, deltaTime : <span class="param-type">number</span>, maskActive : <span class="param-type">boolean</span> )</span> </h3>
  104. <div class="method">
  105. <div class="description">
  106. <p>Performs the pixelation pass.</p>
  107. </div>
  108. <table class="params">
  109. <tbody>
  110. <tr>
  111. <td class="name"><code>renderer</code></td>
  112. <td class="description last"><p>The renderer.</p></td>
  113. </tr>
  114. <tr>
  115. <td class="name"><code>writeBuffer</code></td>
  116. <td class="description last"><p>The write buffer. This buffer is intended as the rendering
  117. destination for the pass.</p></td>
  118. </tr>
  119. <tr>
  120. <td class="name"><code>readBuffer</code></td>
  121. <td class="description last"><p>The read buffer. The pass can access the result from the
  122. previous pass from this buffer.</p></td>
  123. </tr>
  124. <tr>
  125. <td class="name"><code>deltaTime</code></td>
  126. <td class="description last"><p>The delta time in seconds.</p></td>
  127. </tr>
  128. <tr>
  129. <td class="name"><code>maskActive</code></td>
  130. <td class="description last"><p>Whether masking is active or not.</p></td>
  131. </tr>
  132. </tbody>
  133. </table>
  134. <dl class="details">
  135. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#render">Pass#render</a></dt>
  136. </dl>
  137. </div>
  138. <h3 class="name name-method" id="setPixelSize" translate="no">.<a href="#setPixelSize">setPixelSize</a><span class="signature">( pixelSize : <span class="param-type">number</span> )</span> </h3>
  139. <div class="method">
  140. <div class="description">
  141. <p>Sets the effect's pixel size.</p>
  142. </div>
  143. <table class="params">
  144. <tbody>
  145. <tr>
  146. <td class="name"><code>pixelSize</code></td>
  147. <td class="description last"><p>The pixel size to set.</p></td>
  148. </tr>
  149. </tbody>
  150. </table>
  151. </div>
  152. <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>
  153. <div class="method">
  154. <div class="description">
  155. <p>Sets the size of the pass.</p>
  156. </div>
  157. <table class="params">
  158. <tbody>
  159. <tr>
  160. <td class="name"><code>width</code></td>
  161. <td class="description last"><p>The width to set.</p></td>
  162. </tr>
  163. <tr>
  164. <td class="name"><code>height</code></td>
  165. <td class="description last"><p>The height to set.</p></td>
  166. </tr>
  167. </tbody>
  168. </table>
  169. <dl class="details">
  170. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Pass.html#setSize">Pass#setSize</a></dt>
  171. </dl>
  172. </div>
  173. <h2 class="subsection-title">Source</h2>
  174. <p>
  175. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/postprocessing/RenderPixelatedPass.js" target="_blank" rel="noopener" translate="no">examples/jsm/postprocessing/RenderPixelatedPass.js</a>
  176. </p>
  177. </article>
  178. </section>
  179. <script src="../scripts/linenumber.js"></script>
  180. <script src="../scripts/page.js"></script>
  181. </body>
  182. </html>
粤ICP备19079148号