PassNode.html 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>PassNode - 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">PassNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Represents a render pass (sometimes called beauty pass) in context of post processing.
  17. This pass produces a render for the given scene and camera and can provide multiple outputs
  18. via MRT for further processing.</p></div>
  19. <h2>Code Example</h2>
  20. <div translate="no"><pre><code class="language-js">const postProcessing = new PostProcessing( renderer );
  21. const scenePass = pass( scene, camera );
  22. postProcessing.outputNode = scenePass;
  23. </code></pre></div>
  24. </header>
  25. <article>
  26. <div class="container-overview">
  27. <h2>Constructor</h2>
  28. <h3 class="name name-method" id="PassNode" translate="no">new <a href="#PassNode">PassNode</a><span class="signature">( scope : <span class="param-type">'color' | 'depth'</span>, scene : <span class="param-type"><a href="Scene.html">Scene</a></span>, camera : <span class="param-type"><a href="Camera.html">Camera</a></span>, options : <span class="param-type">Object</span> )</span> </h3>
  29. <div class="method">
  30. <div class="description">
  31. <p>Constructs a new pass node.</p>
  32. </div>
  33. <table class="params">
  34. <tbody>
  35. <tr>
  36. <td class="name">
  37. <strong>scope</strong>
  38. </td>
  39. <td class="description last">
  40. <p>The scope of the pass. The scope determines whether the node outputs color or depth.</p>
  41. </td>
  42. </tr>
  43. <tr>
  44. <td class="name">
  45. <strong>scene</strong>
  46. </td>
  47. <td class="description last">
  48. <p>A reference to the scene.</p>
  49. </td>
  50. </tr>
  51. <tr>
  52. <td class="name">
  53. <strong>camera</strong>
  54. </td>
  55. <td class="description last">
  56. <p>A reference to the camera.</p>
  57. </td>
  58. </tr>
  59. <tr>
  60. <td class="name">
  61. <strong>options</strong>
  62. </td>
  63. <td class="description last">
  64. <p>Options for the internal render target.</p>
  65. </td>
  66. </tr>
  67. </tbody>
  68. </table>
  69. </div>
  70. </div>
  71. <h2 class="subsection-title">Properties</h2>
  72. <div class="member">
  73. <h3 class="name" id="camera" translate="no">.<a href="#camera">camera</a><span class="type-signature"> : <a href="Camera.html">Camera</a></span> </h3>
  74. <div class="description">
  75. <p>A reference to the camera.</p>
  76. </div>
  77. </div>
  78. <div class="member">
  79. <h3 class="name" id="contextNode" translate="no">.<a href="#contextNode">contextNode</a><span class="type-signature"> : <a href="ContextNode.html">ContextNode</a> | null</span> </h3>
  80. <div class="description">
  81. <p>An optional global context for the pass.</p>
  82. </div>
  83. </div>
  84. <div class="member">
  85. <h3 class="name" id="global" translate="no">.<a href="#global">global</a><span class="type-signature"> : boolean</span> </h3>
  86. <div class="description">
  87. <p>This flag is used for global cache.</p>
  88. <p>Default is <code>true</code>.</p>
  89. </div>
  90. <dl class="details">
  91. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#global">TempNode#global</a></dt>
  92. </dl>
  93. </div>
  94. <div class="member">
  95. <h3 class="name" id="isPassNode" translate="no">.<a href="#isPassNode">isPassNode</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  96. <div class="description">
  97. <p>This flag can be used for type testing.</p>
  98. <p>Default is <code>true</code>.</p>
  99. </div>
  100. </div>
  101. <div class="member">
  102. <h3 class="name" id="opaque" translate="no">.<a href="#opaque">opaque</a><span class="type-signature"> : boolean</span> </h3>
  103. <div class="description">
  104. <p>Whether the pass is opaque.</p>
  105. <p>Default is <code>true</code>.</p>
  106. </div>
  107. </div>
  108. <div class="member">
  109. <h3 class="name" id="options" translate="no">.<a href="#options">options</a><span class="type-signature"> : Object</span> </h3>
  110. <div class="description">
  111. <p>Options for the internal render target.</p>
  112. </div>
  113. </div>
  114. <div class="member">
  115. <h3 class="name" id="overrideMaterial" translate="no">.<a href="#overrideMaterial">overrideMaterial</a><span class="type-signature"> : <a href="Material.html">Material</a> | null</span> </h3>
  116. <div class="description">
  117. <p>An optional override material for the pass.</p>
  118. </div>
  119. </div>
  120. <div class="member">
  121. <h3 class="name" id="renderTarget" translate="no">.<a href="#renderTarget">renderTarget</a><span class="type-signature"> : <a href="RenderTarget.html">RenderTarget</a></span> </h3>
  122. <div class="description">
  123. <p>The pass's render target.</p>
  124. </div>
  125. </div>
  126. <div class="member">
  127. <h3 class="name" id="scene" translate="no">.<a href="#scene">scene</a><span class="type-signature"> : <a href="Scene.html">Scene</a></span> </h3>
  128. <div class="description">
  129. <p>A reference to the scene.</p>
  130. </div>
  131. </div>
  132. <div class="member">
  133. <h3 class="name" id="scope" translate="no">.<a href="#scope">scope</a><span class="type-signature"> : 'color' | 'depth'</span> </h3>
  134. <div class="description">
  135. <p>The scope of the pass. The scope determines whether the node outputs color or depth.</p>
  136. </div>
  137. </div>
  138. <div class="member">
  139. <h3 class="name" id="transparent" translate="no">.<a href="#transparent">transparent</a><span class="type-signature"> : boolean</span> </h3>
  140. <div class="description">
  141. <p>Whether the pass is transparent.</p>
  142. <p>Default is <code>false</code>.</p>
  143. </div>
  144. </div>
  145. <div class="member">
  146. <h3 class="name" id="updateBeforeType" translate="no">.<a href="#updateBeforeType">updateBeforeType</a><span class="type-signature"> : string</span> </h3>
  147. <div class="description">
  148. <p>The <code>updateBeforeType</code> is set to <code>NodeUpdateType.FRAME</code> since the node renders the
  149. scene once per frame in its <a href="PassNode.html#updateBefore">PassNode#updateBefore</a> method.</p>
  150. <p>Default is <code>'frame'</code>.</p>
  151. </div>
  152. <dl class="details">
  153. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#updateBeforeType">TempNode#updateBeforeType</a></dt>
  154. </dl>
  155. </div>
  156. <div class="member">
  157. <h3 class="name" id=".COLOR" translate="no">.<a href="#.COLOR">COLOR</a><span class="type-signature"> : 'color'</span> </h3>
  158. </div>
  159. <div class="member">
  160. <h3 class="name" id=".DEPTH" translate="no">.<a href="#.DEPTH">DEPTH</a><span class="type-signature"> : 'depth'</span> </h3>
  161. </div>
  162. <h2 class="subsection-title">Methods</h2>
  163. <h3 class="name name-method" id="compileAsync" translate="no">.<a href="#compileAsync">compileAsync</a><span class="signature">( renderer : <span class="param-type"><a href="Renderer.html">Renderer</a></span> )</span><span class="type-signature"> : Promise</span> <span class="type-signature">(async) </span></h3>
  164. <div class="method">
  165. <div class="description">
  166. <p>Precompiles the pass.</p>
  167. <p>Note that this method must be called after the pass configuration is complete.
  168. So calls like <code>setMRT()</code> and <code>getTextureNode()</code> must proceed the precompilation.</p>
  169. </div>
  170. <table class="params">
  171. <tbody>
  172. <tr>
  173. <td class="name">
  174. <strong>renderer</strong>
  175. </td>
  176. <td class="description last">
  177. <p>The renderer.</p>
  178. </td>
  179. </tr>
  180. </tbody>
  181. </table>
  182. <dl class="details">
  183. <dt class="tag-see">See:</dt>
  184. <dd class="tag-see">
  185. <ul>
  186. <li><a href="Renderer.html#compileAsync">Renderer#compileAsync</a></li>
  187. </ul>
  188. </dd>
  189. </dl>
  190. <dl class="details">
  191. <dt class="tag-returns"><strong>Returns:</strong> A Promise that resolves when the compile has been finished.</dt>
  192. </dl>
  193. </div>
  194. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  195. <div class="method">
  196. <div class="description">
  197. <p>Frees internal resources. Should be called when the node is no longer in use.</p>
  198. </div>
  199. <dl class="details">
  200. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#dispose">TempNode#dispose</a></dt>
  201. </dl>
  202. </div>
  203. <h3 class="name name-method" id="getLayers" translate="no">.<a href="#getLayers">getLayers</a><span class="signature">()</span><span class="type-signature"> : <a href="Layers.html">Layers</a></span> </h3>
  204. <div class="method">
  205. <div class="description">
  206. <p>Gets the current layer configuration of the pass.</p>
  207. </div>
  208. <dl class="details">
  209. <dt class="tag-returns"><strong>Returns:</strong> .</dt>
  210. </dl>
  211. </div>
  212. <h3 class="name name-method" id="getLinearDepthNode" translate="no">.<a href="#getLinearDepthNode">getLinearDepthNode</a><span class="signature">( name : <span class="param-type">string</span> )</span><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
  213. <div class="method">
  214. <div class="description">
  215. <p>Returns a linear depth node of this pass.</p>
  216. </div>
  217. <table class="params">
  218. <tbody>
  219. <tr>
  220. <td class="name">
  221. <strong>name</strong>
  222. </td>
  223. <td class="description last">
  224. <p>The output name to get the linear depth node for. In most cases the default <code>'depth'</code> can be used however the parameter exists for custom depth outputs.</p>
  225. <p>Default is <code>'depth'</code>.</p>
  226. </td>
  227. </tr>
  228. </tbody>
  229. </table>
  230. <dl class="details">
  231. <dt class="tag-returns"><strong>Returns:</strong> The linear depth node.</dt>
  232. </dl>
  233. </div>
  234. <h3 class="name name-method" id="getMRT" translate="no">.<a href="#getMRT">getMRT</a><span class="signature">()</span><span class="type-signature"> : <a href="MRTNode.html">MRTNode</a></span> </h3>
  235. <div class="method">
  236. <div class="description">
  237. <p>Returns the current MRT node.</p>
  238. </div>
  239. <dl class="details">
  240. <dt class="tag-returns"><strong>Returns:</strong> The current MRT node.</dt>
  241. </dl>
  242. </div>
  243. <h3 class="name name-method" id="getPreviousTexture" translate="no">.<a href="#getPreviousTexture">getPreviousTexture</a><span class="signature">( name : <span class="param-type">string</span> )</span><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  244. <div class="method">
  245. <div class="description">
  246. <p>Returns the texture holding the data of the previous frame for the given output name.</p>
  247. </div>
  248. <table class="params">
  249. <tbody>
  250. <tr>
  251. <td class="name">
  252. <strong>name</strong>
  253. </td>
  254. <td class="description last">
  255. <p>The output name to get the texture for.</p>
  256. </td>
  257. </tr>
  258. </tbody>
  259. </table>
  260. <dl class="details">
  261. <dt class="tag-returns"><strong>Returns:</strong> The texture holding the data of the previous frame.</dt>
  262. </dl>
  263. </div>
  264. <h3 class="name name-method" id="getPreviousTextureNode" translate="no">.<a href="#getPreviousTextureNode">getPreviousTextureNode</a><span class="signature">( name : <span class="param-type">string</span> )</span><span class="type-signature"> : <a href="TextureNode.html">TextureNode</a></span> </h3>
  265. <div class="method">
  266. <div class="description">
  267. <p>Returns the previous texture node for the given output name.</p>
  268. </div>
  269. <table class="params">
  270. <tbody>
  271. <tr>
  272. <td class="name">
  273. <strong>name</strong>
  274. </td>
  275. <td class="description last">
  276. <p>The output name to get the previous texture node for.</p>
  277. <p>Default is <code>'output'</code>.</p>
  278. </td>
  279. </tr>
  280. </tbody>
  281. </table>
  282. <dl class="details">
  283. <dt class="tag-returns"><strong>Returns:</strong> The previous texture node.</dt>
  284. </dl>
  285. </div>
  286. <h3 class="name name-method" id="getResolution" translate="no">.<a href="#getResolution">getResolution</a><span class="signature">()</span><span class="type-signature"> : number</span> </h3>
  287. <div class="method">
  288. <div class="description">
  289. <p>Gets the current resolution of the pass.</p>
  290. </div>
  291. <dl class="details">
  292. <dt class="important tag-deprecated"><strong>Deprecated:</strong> since r181. Use <a href="PassNode.html#getResolutionScale">`getResolutionScale()`</a> instead.</dt>
  293. </dl>
  294. <dl class="details">
  295. <dt class="tag-returns"><strong>Returns:</strong> The current resolution. A value of <code>1</code> means full resolution.</dt>
  296. </dl>
  297. </div>
  298. <h3 class="name name-method" id="getResolutionScale" translate="no">.<a href="#getResolutionScale">getResolutionScale</a><span class="signature">()</span><span class="type-signature"> : number</span> </h3>
  299. <div class="method">
  300. <div class="description">
  301. <p>Gets the current resolution scale of the pass.</p>
  302. </div>
  303. <dl class="details">
  304. <dt class="tag-returns"><strong>Returns:</strong> The current resolution scale. A value of <code>1</code> means full resolution.</dt>
  305. </dl>
  306. </div>
  307. <h3 class="name name-method" id="getTexture" translate="no">.<a href="#getTexture">getTexture</a><span class="signature">( name : <span class="param-type">string</span> )</span><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  308. <div class="method">
  309. <div class="description">
  310. <p>Returns the texture for the given output name.</p>
  311. </div>
  312. <table class="params">
  313. <tbody>
  314. <tr>
  315. <td class="name">
  316. <strong>name</strong>
  317. </td>
  318. <td class="description last">
  319. <p>The output name to get the texture for.</p>
  320. </td>
  321. </tr>
  322. </tbody>
  323. </table>
  324. <dl class="details">
  325. <dt class="tag-returns"><strong>Returns:</strong> The texture.</dt>
  326. </dl>
  327. </div>
  328. <h3 class="name name-method" id="getTextureNode" translate="no">.<a href="#getTextureNode">getTextureNode</a><span class="signature">( name : <span class="param-type">string</span> )</span><span class="type-signature"> : <a href="TextureNode.html">TextureNode</a></span> </h3>
  329. <div class="method">
  330. <div class="description">
  331. <p>Returns the texture node for the given output name.</p>
  332. </div>
  333. <table class="params">
  334. <tbody>
  335. <tr>
  336. <td class="name">
  337. <strong>name</strong>
  338. </td>
  339. <td class="description last">
  340. <p>The output name to get the texture node for.</p>
  341. <p>Default is <code>'output'</code>.</p>
  342. </td>
  343. </tr>
  344. </tbody>
  345. </table>
  346. <dl class="details">
  347. <dt class="tag-returns"><strong>Returns:</strong> The texture node.</dt>
  348. </dl>
  349. </div>
  350. <h3 class="name name-method" id="getViewZNode" translate="no">.<a href="#getViewZNode">getViewZNode</a><span class="signature">( name : <span class="param-type">string</span> )</span><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
  351. <div class="method">
  352. <div class="description">
  353. <p>Returns a viewZ node of this pass.</p>
  354. </div>
  355. <table class="params">
  356. <tbody>
  357. <tr>
  358. <td class="name">
  359. <strong>name</strong>
  360. </td>
  361. <td class="description last">
  362. <p>The output name to get the viewZ node for. In most cases the default <code>'depth'</code> can be used however the parameter exists for custom depth outputs.</p>
  363. <p>Default is <code>'depth'</code>.</p>
  364. </td>
  365. </tr>
  366. </tbody>
  367. </table>
  368. <dl class="details">
  369. <dt class="tag-returns"><strong>Returns:</strong> The viewZ node.</dt>
  370. </dl>
  371. </div>
  372. <h3 class="name name-method" id="setLayers" translate="no">.<a href="#setLayers">setLayers</a><span class="signature">( layers : <span class="param-type"><a href="Layers.html">Layers</a></span> )</span><span class="type-signature"> : <a href="PassNode.html">PassNode</a></span> </h3>
  373. <div class="method">
  374. <div class="description">
  375. <p>Sets the layer configuration that should be used when rendering the pass.</p>
  376. </div>
  377. <table class="params">
  378. <tbody>
  379. <tr>
  380. <td class="name">
  381. <strong>layers</strong>
  382. </td>
  383. <td class="description last">
  384. <p>The layers object to set.</p>
  385. </td>
  386. </tr>
  387. </tbody>
  388. </table>
  389. <dl class="details">
  390. <dt class="tag-returns"><strong>Returns:</strong> A reference to this pass.</dt>
  391. </dl>
  392. </div>
  393. <h3 class="name name-method" id="setMRT" translate="no">.<a href="#setMRT">setMRT</a><span class="signature">( mrt : <span class="param-type"><a href="MRTNode.html">MRTNode</a></span> )</span><span class="type-signature"> : <a href="PassNode.html">PassNode</a></span> </h3>
  394. <div class="method">
  395. <div class="description">
  396. <p>Sets the given MRT node to setup MRT for this pass.</p>
  397. </div>
  398. <table class="params">
  399. <tbody>
  400. <tr>
  401. <td class="name">
  402. <strong>mrt</strong>
  403. </td>
  404. <td class="description last">
  405. <p>The MRT object.</p>
  406. </td>
  407. </tr>
  408. </tbody>
  409. </table>
  410. <dl class="details">
  411. <dt class="tag-returns"><strong>Returns:</strong> A reference to this pass.</dt>
  412. </dl>
  413. </div>
  414. <h3 class="name name-method" id="setPixelRatio" translate="no">.<a href="#setPixelRatio">setPixelRatio</a><span class="signature">( pixelRatio : <span class="param-type">number</span> )</span> </h3>
  415. <div class="method">
  416. <div class="description">
  417. <p>Sets the pixel ratio the pass's render target and updates the size.</p>
  418. </div>
  419. <table class="params">
  420. <tbody>
  421. <tr>
  422. <td class="name">
  423. <strong>pixelRatio</strong>
  424. </td>
  425. <td class="description last">
  426. <p>The pixel ratio to set.</p>
  427. </td>
  428. </tr>
  429. </tbody>
  430. </table>
  431. </div>
  432. <h3 class="name name-method" id="setResolution" translate="no">.<a href="#setResolution">setResolution</a><span class="signature">( resolution : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="PassNode.html">PassNode</a></span> </h3>
  433. <div class="method">
  434. <div class="description">
  435. <p>Sets the resolution for the pass.
  436. The resolution is a factor that is multiplied with the renderer's width and height.</p>
  437. </div>
  438. <table class="params">
  439. <tbody>
  440. <tr>
  441. <td class="name">
  442. <strong>resolution</strong>
  443. </td>
  444. <td class="description last">
  445. <p>The resolution to set. A value of <code>1</code> means full resolution.</p>
  446. </td>
  447. </tr>
  448. </tbody>
  449. </table>
  450. <dl class="details">
  451. <dt class="important tag-deprecated"><strong>Deprecated:</strong> since r181. Use <a href="PassNode.html#setResolutionScale">`setResolutionScale()`</a> instead.</dt>
  452. </dl>
  453. <dl class="details">
  454. <dt class="tag-returns"><strong>Returns:</strong> A reference to this pass.</dt>
  455. </dl>
  456. </div>
  457. <h3 class="name name-method" id="setResolutionScale" translate="no">.<a href="#setResolutionScale">setResolutionScale</a><span class="signature">( resolutionScale : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="PassNode.html">PassNode</a></span> </h3>
  458. <div class="method">
  459. <div class="description">
  460. <p>Sets the resolution scale for the pass.
  461. The resolution scale is a factor that is multiplied with the renderer's width and height.</p>
  462. </div>
  463. <table class="params">
  464. <tbody>
  465. <tr>
  466. <td class="name">
  467. <strong>resolutionScale</strong>
  468. </td>
  469. <td class="description last">
  470. <p>The resolution scale to set. A value of <code>1</code> means full resolution.</p>
  471. </td>
  472. </tr>
  473. </tbody>
  474. </table>
  475. <dl class="details">
  476. <dt class="tag-returns"><strong>Returns:</strong> A reference to this pass.</dt>
  477. </dl>
  478. </div>
  479. <h3 class="name name-method" id="setScissor" translate="no">.<a href="#setScissor">setScissor</a><span class="signature">( x : <span class="param-type">number | <a href="Vector4.html">Vector4</a></span>, y : <span class="param-type">number</span>, width : <span class="param-type">number</span>, height : <span class="param-type">number</span> )</span> </h3>
  480. <div class="method">
  481. <div class="description">
  482. <p>This method allows to define the pass's scissor rectangle. By default, the scissor rectangle is kept
  483. in sync with the pass's dimensions. To reverse the process and use auto-sizing again, call the method
  484. with <code>null</code> as the single argument.</p>
  485. </div>
  486. <table class="params">
  487. <tbody>
  488. <tr>
  489. <td class="name">
  490. <strong>x</strong>
  491. </td>
  492. <td class="description last">
  493. <p>The horizontal coordinate for the lower left corner of the box in logical pixel unit.
  494. Instead of passing four arguments, the method also works with a single four-dimensional vector.</p>
  495. </td>
  496. </tr>
  497. <tr>
  498. <td class="name">
  499. <strong>y</strong>
  500. </td>
  501. <td class="description last">
  502. <p>The vertical coordinate for the lower left corner of the box in logical pixel unit.</p>
  503. </td>
  504. </tr>
  505. <tr>
  506. <td class="name">
  507. <strong>width</strong>
  508. </td>
  509. <td class="description last">
  510. <p>The width of the scissor box in logical pixel unit.</p>
  511. </td>
  512. </tr>
  513. <tr>
  514. <td class="name">
  515. <strong>height</strong>
  516. </td>
  517. <td class="description last">
  518. <p>The height of the scissor box in logical pixel unit.</p>
  519. </td>
  520. </tr>
  521. </tbody>
  522. </table>
  523. </div>
  524. <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>
  525. <div class="method">
  526. <div class="description">
  527. <p>Sets the size of the pass's render target. Honors the pixel ratio.</p>
  528. </div>
  529. <table class="params">
  530. <tbody>
  531. <tr>
  532. <td class="name">
  533. <strong>width</strong>
  534. </td>
  535. <td class="description last">
  536. <p>The width to set.</p>
  537. </td>
  538. </tr>
  539. <tr>
  540. <td class="name">
  541. <strong>height</strong>
  542. </td>
  543. <td class="description last">
  544. <p>The height to set.</p>
  545. </td>
  546. </tr>
  547. </tbody>
  548. </table>
  549. </div>
  550. <h3 class="name name-method" id="setViewport" translate="no">.<a href="#setViewport">setViewport</a><span class="signature">( x : <span class="param-type">number | <a href="Vector4.html">Vector4</a></span>, y : <span class="param-type">number</span>, width : <span class="param-type">number</span>, height : <span class="param-type">number</span> )</span> </h3>
  551. <div class="method">
  552. <div class="description">
  553. <p>This method allows to define the pass's viewport. By default, the viewport is kept in sync
  554. with the pass's dimensions. To reverse the process and use auto-sizing again, call the method
  555. with <code>null</code> as the single argument.</p>
  556. </div>
  557. <table class="params">
  558. <tbody>
  559. <tr>
  560. <td class="name">
  561. <strong>x</strong>
  562. </td>
  563. <td class="description last">
  564. <p>The horizontal coordinate for the lower left corner of the viewport origin in logical pixel unit.</p>
  565. </td>
  566. </tr>
  567. <tr>
  568. <td class="name">
  569. <strong>y</strong>
  570. </td>
  571. <td class="description last">
  572. <p>The vertical coordinate for the lower left corner of the viewport origin in logical pixel unit.</p>
  573. </td>
  574. </tr>
  575. <tr>
  576. <td class="name">
  577. <strong>width</strong>
  578. </td>
  579. <td class="description last">
  580. <p>The width of the viewport in logical pixel unit.</p>
  581. </td>
  582. </tr>
  583. <tr>
  584. <td class="name">
  585. <strong>height</strong>
  586. </td>
  587. <td class="description last">
  588. <p>The height of the viewport in logical pixel unit.</p>
  589. </td>
  590. </tr>
  591. </tbody>
  592. </table>
  593. </div>
  594. <h3 class="name name-method" id="toggleTexture" translate="no">.<a href="#toggleTexture">toggleTexture</a><span class="signature">( name : <span class="param-type">string</span> )</span> </h3>
  595. <div class="method">
  596. <div class="description">
  597. <p>Switches current and previous textures for the given output name.</p>
  598. </div>
  599. <table class="params">
  600. <tbody>
  601. <tr>
  602. <td class="name">
  603. <strong>name</strong>
  604. </td>
  605. <td class="description last">
  606. <p>The output name.</p>
  607. </td>
  608. </tr>
  609. </tbody>
  610. </table>
  611. </div>
  612. <h2 class="subsection-title">Source</h2>
  613. <p>
  614. <a href="https://github.com/mrdoob/three.js/blob/master/src/nodes/display/PassNode.js" translate="no" target="_blank" rel="noopener">src/nodes/display/PassNode.js</a>
  615. </p>
  616. </article>
  617. </section>
  618. <script src="../scripts/linenumber.js"></script>
  619. <script src="../scripts/page.js"></script>
  620. </body>
  621. </html>
粤ICP备19079148号