PassNode.html 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595
  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="global" translate="no">.<a href="#global">global</a><span class="type-signature"> : boolean</span> </h3>
  80. <div class="description">
  81. <p>This flag is used for global cache.</p>
  82. <p>Default is <code>true</code>.</p>
  83. </div>
  84. <dl class="details">
  85. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#global">TempNode#global</a></dt>
  86. </dl>
  87. </div>
  88. <div class="member">
  89. <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>
  90. <div class="description">
  91. <p>This flag can be used for type testing.</p>
  92. <p>Default is <code>true</code>.</p>
  93. </div>
  94. </div>
  95. <div class="member">
  96. <h3 class="name" id="options" translate="no">.<a href="#options">options</a><span class="type-signature"> : Object</span> </h3>
  97. <div class="description">
  98. <p>Options for the internal render target.</p>
  99. </div>
  100. </div>
  101. <div class="member">
  102. <h3 class="name" id="renderTarget" translate="no">.<a href="#renderTarget">renderTarget</a><span class="type-signature"> : <a href="RenderTarget.html">RenderTarget</a></span> </h3>
  103. <div class="description">
  104. <p>The pass's render target.</p>
  105. </div>
  106. </div>
  107. <div class="member">
  108. <h3 class="name" id="scene" translate="no">.<a href="#scene">scene</a><span class="type-signature"> : <a href="Scene.html">Scene</a></span> </h3>
  109. <div class="description">
  110. <p>A reference to the scene.</p>
  111. </div>
  112. </div>
  113. <div class="member">
  114. <h3 class="name" id="scope" translate="no">.<a href="#scope">scope</a><span class="type-signature"> : 'color' | 'depth'</span> </h3>
  115. <div class="description">
  116. <p>The scope of the pass. The scope determines whether the node outputs color or depth.</p>
  117. </div>
  118. </div>
  119. <div class="member">
  120. <h3 class="name" id="updateBeforeType" translate="no">.<a href="#updateBeforeType">updateBeforeType</a><span class="type-signature"> : string</span> </h3>
  121. <div class="description">
  122. <p>The <code>updateBeforeType</code> is set to <code>NodeUpdateType.FRAME</code> since the node renders the
  123. scene once per frame in its <a href="PassNode.html#updateBefore">PassNode#updateBefore</a> method.</p>
  124. <p>Default is <code>'frame'</code>.</p>
  125. </div>
  126. <dl class="details">
  127. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#updateBeforeType">TempNode#updateBeforeType</a></dt>
  128. </dl>
  129. </div>
  130. <div class="member">
  131. <h3 class="name" id=".COLOR" translate="no">.<a href="#.COLOR">COLOR</a><span class="type-signature"> : 'color'</span> </h3>
  132. </div>
  133. <div class="member">
  134. <h3 class="name" id=".DEPTH" translate="no">.<a href="#.DEPTH">DEPTH</a><span class="type-signature"> : 'depth'</span> </h3>
  135. </div>
  136. <h2 class="subsection-title">Methods</h2>
  137. <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>
  138. <div class="method">
  139. <div class="description">
  140. <p>Precompiles the pass.</p>
  141. <p>Note that this method must be called after the pass configuration is complete.
  142. So calls like <code>setMRT()</code> and <code>getTextureNode()</code> must proceed the precompilation.</p>
  143. </div>
  144. <table class="params">
  145. <tbody>
  146. <tr>
  147. <td class="name">
  148. <strong>renderer</strong>
  149. </td>
  150. <td class="description last">
  151. <p>The renderer.</p>
  152. </td>
  153. </tr>
  154. </tbody>
  155. </table>
  156. <dl class="details">
  157. <dt class="tag-see">See:</dt>
  158. <dd class="tag-see">
  159. <ul>
  160. <li><a href="Renderer.html#compileAsync">Renderer#compileAsync</a></li>
  161. </ul>
  162. </dd>
  163. </dl>
  164. <dl class="details">
  165. <dt class="tag-returns"><strong>Returns:</strong> A Promise that resolves when the compile has been finished.</dt>
  166. </dl>
  167. </div>
  168. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  169. <div class="method">
  170. <div class="description">
  171. <p>Frees internal resources. Should be called when the node is no longer in use.</p>
  172. </div>
  173. <dl class="details">
  174. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="TempNode.html#dispose">TempNode#dispose</a></dt>
  175. </dl>
  176. </div>
  177. <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>
  178. <div class="method">
  179. <div class="description">
  180. <p>Gets the current layer configuration of the pass.</p>
  181. </div>
  182. <dl class="details">
  183. <dt class="tag-returns"><strong>Returns:</strong> .</dt>
  184. </dl>
  185. </div>
  186. <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>
  187. <div class="method">
  188. <div class="description">
  189. <p>Returns a linear depth node of this pass.</p>
  190. </div>
  191. <table class="params">
  192. <tbody>
  193. <tr>
  194. <td class="name">
  195. <strong>name</strong>
  196. </td>
  197. <td class="description last">
  198. <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>
  199. <p>Default is <code>'depth'</code>.</p>
  200. </td>
  201. </tr>
  202. </tbody>
  203. </table>
  204. <dl class="details">
  205. <dt class="tag-returns"><strong>Returns:</strong> The linear depth node.</dt>
  206. </dl>
  207. </div>
  208. <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>
  209. <div class="method">
  210. <div class="description">
  211. <p>Returns the current MRT node.</p>
  212. </div>
  213. <dl class="details">
  214. <dt class="tag-returns"><strong>Returns:</strong> The current MRT node.</dt>
  215. </dl>
  216. </div>
  217. <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>
  218. <div class="method">
  219. <div class="description">
  220. <p>Returns the texture holding the data of the previous frame for the given output name.</p>
  221. </div>
  222. <table class="params">
  223. <tbody>
  224. <tr>
  225. <td class="name">
  226. <strong>name</strong>
  227. </td>
  228. <td class="description last">
  229. <p>The output name to get the texture for.</p>
  230. </td>
  231. </tr>
  232. </tbody>
  233. </table>
  234. <dl class="details">
  235. <dt class="tag-returns"><strong>Returns:</strong> The texture holding the data of the previous frame.</dt>
  236. </dl>
  237. </div>
  238. <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>
  239. <div class="method">
  240. <div class="description">
  241. <p>Returns the previous texture node for the given output name.</p>
  242. </div>
  243. <table class="params">
  244. <tbody>
  245. <tr>
  246. <td class="name">
  247. <strong>name</strong>
  248. </td>
  249. <td class="description last">
  250. <p>The output name to get the previous texture node for.</p>
  251. <p>Default is <code>'output'</code>.</p>
  252. </td>
  253. </tr>
  254. </tbody>
  255. </table>
  256. <dl class="details">
  257. <dt class="tag-returns"><strong>Returns:</strong> The previous texture node.</dt>
  258. </dl>
  259. </div>
  260. <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>
  261. <div class="method">
  262. <div class="description">
  263. <p>Gets the current resolution of the pass.</p>
  264. </div>
  265. <dl class="details">
  266. <dt class="important tag-deprecated"><strong>Deprecated:</strong> since r181. Use <a href="PassNode.html#getResolutionScale">`getResolutionScale()`</a> instead.</dt>
  267. </dl>
  268. <dl class="details">
  269. <dt class="tag-returns"><strong>Returns:</strong> The current resolution. A value of <code>1</code> means full resolution.</dt>
  270. </dl>
  271. </div>
  272. <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>
  273. <div class="method">
  274. <div class="description">
  275. <p>Gets the current resolution scale of the pass.</p>
  276. </div>
  277. <dl class="details">
  278. <dt class="tag-returns"><strong>Returns:</strong> The current resolution scale. A value of <code>1</code> means full resolution.</dt>
  279. </dl>
  280. </div>
  281. <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>
  282. <div class="method">
  283. <div class="description">
  284. <p>Returns the texture for the given output name.</p>
  285. </div>
  286. <table class="params">
  287. <tbody>
  288. <tr>
  289. <td class="name">
  290. <strong>name</strong>
  291. </td>
  292. <td class="description last">
  293. <p>The output name to get the texture for.</p>
  294. </td>
  295. </tr>
  296. </tbody>
  297. </table>
  298. <dl class="details">
  299. <dt class="tag-returns"><strong>Returns:</strong> The texture.</dt>
  300. </dl>
  301. </div>
  302. <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>
  303. <div class="method">
  304. <div class="description">
  305. <p>Returns the texture node for the given output name.</p>
  306. </div>
  307. <table class="params">
  308. <tbody>
  309. <tr>
  310. <td class="name">
  311. <strong>name</strong>
  312. </td>
  313. <td class="description last">
  314. <p>The output name to get the texture node for.</p>
  315. <p>Default is <code>'output'</code>.</p>
  316. </td>
  317. </tr>
  318. </tbody>
  319. </table>
  320. <dl class="details">
  321. <dt class="tag-returns"><strong>Returns:</strong> The texture node.</dt>
  322. </dl>
  323. </div>
  324. <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>
  325. <div class="method">
  326. <div class="description">
  327. <p>Returns a viewZ node of this pass.</p>
  328. </div>
  329. <table class="params">
  330. <tbody>
  331. <tr>
  332. <td class="name">
  333. <strong>name</strong>
  334. </td>
  335. <td class="description last">
  336. <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>
  337. <p>Default is <code>'depth'</code>.</p>
  338. </td>
  339. </tr>
  340. </tbody>
  341. </table>
  342. <dl class="details">
  343. <dt class="tag-returns"><strong>Returns:</strong> The viewZ node.</dt>
  344. </dl>
  345. </div>
  346. <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>
  347. <div class="method">
  348. <div class="description">
  349. <p>Sets the layer configuration that should be used when rendering the pass.</p>
  350. </div>
  351. <table class="params">
  352. <tbody>
  353. <tr>
  354. <td class="name">
  355. <strong>layers</strong>
  356. </td>
  357. <td class="description last">
  358. <p>The layers object to set.</p>
  359. </td>
  360. </tr>
  361. </tbody>
  362. </table>
  363. <dl class="details">
  364. <dt class="tag-returns"><strong>Returns:</strong> A reference to this pass.</dt>
  365. </dl>
  366. </div>
  367. <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>
  368. <div class="method">
  369. <div class="description">
  370. <p>Sets the given MRT node to setup MRT for this pass.</p>
  371. </div>
  372. <table class="params">
  373. <tbody>
  374. <tr>
  375. <td class="name">
  376. <strong>mrt</strong>
  377. </td>
  378. <td class="description last">
  379. <p>The MRT object.</p>
  380. </td>
  381. </tr>
  382. </tbody>
  383. </table>
  384. <dl class="details">
  385. <dt class="tag-returns"><strong>Returns:</strong> A reference to this pass.</dt>
  386. </dl>
  387. </div>
  388. <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>
  389. <div class="method">
  390. <div class="description">
  391. <p>Sets the pixel ratio the pass's render target and updates the size.</p>
  392. </div>
  393. <table class="params">
  394. <tbody>
  395. <tr>
  396. <td class="name">
  397. <strong>pixelRatio</strong>
  398. </td>
  399. <td class="description last">
  400. <p>The pixel ratio to set.</p>
  401. </td>
  402. </tr>
  403. </tbody>
  404. </table>
  405. </div>
  406. <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>
  407. <div class="method">
  408. <div class="description">
  409. <p>Sets the resolution for the pass.
  410. The resolution is a factor that is multiplied with the renderer's width and height.</p>
  411. </div>
  412. <table class="params">
  413. <tbody>
  414. <tr>
  415. <td class="name">
  416. <strong>resolution</strong>
  417. </td>
  418. <td class="description last">
  419. <p>The resolution to set. A value of <code>1</code> means full resolution.</p>
  420. </td>
  421. </tr>
  422. </tbody>
  423. </table>
  424. <dl class="details">
  425. <dt class="important tag-deprecated"><strong>Deprecated:</strong> since r181. Use <a href="PassNode.html#setResolutionScale">`setResolutionScale()`</a> instead.</dt>
  426. </dl>
  427. <dl class="details">
  428. <dt class="tag-returns"><strong>Returns:</strong> A reference to this pass.</dt>
  429. </dl>
  430. </div>
  431. <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>
  432. <div class="method">
  433. <div class="description">
  434. <p>Sets the resolution scale for the pass.
  435. The resolution scale is a factor that is multiplied with the renderer's width and height.</p>
  436. </div>
  437. <table class="params">
  438. <tbody>
  439. <tr>
  440. <td class="name">
  441. <strong>resolutionScale</strong>
  442. </td>
  443. <td class="description last">
  444. <p>The resolution scale to set. A value of <code>1</code> means full resolution.</p>
  445. </td>
  446. </tr>
  447. </tbody>
  448. </table>
  449. <dl class="details">
  450. <dt class="tag-returns"><strong>Returns:</strong> A reference to this pass.</dt>
  451. </dl>
  452. </div>
  453. <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>
  454. <div class="method">
  455. <div class="description">
  456. <p>This method allows to define the pass's scissor rectangle. By default, the scissor rectangle is kept
  457. in sync with the pass's dimensions. To reverse the process and use auto-sizing again, call the method
  458. with <code>null</code> as the single argument.</p>
  459. </div>
  460. <table class="params">
  461. <tbody>
  462. <tr>
  463. <td class="name">
  464. <strong>x</strong>
  465. </td>
  466. <td class="description last">
  467. <p>The horizontal coordinate for the lower left corner of the box in logical pixel unit.
  468. Instead of passing four arguments, the method also works with a single four-dimensional vector.</p>
  469. </td>
  470. </tr>
  471. <tr>
  472. <td class="name">
  473. <strong>y</strong>
  474. </td>
  475. <td class="description last">
  476. <p>The vertical coordinate for the lower left corner of the box in logical pixel unit.</p>
  477. </td>
  478. </tr>
  479. <tr>
  480. <td class="name">
  481. <strong>width</strong>
  482. </td>
  483. <td class="description last">
  484. <p>The width of the scissor box in logical pixel unit.</p>
  485. </td>
  486. </tr>
  487. <tr>
  488. <td class="name">
  489. <strong>height</strong>
  490. </td>
  491. <td class="description last">
  492. <p>The height of the scissor box in logical pixel unit.</p>
  493. </td>
  494. </tr>
  495. </tbody>
  496. </table>
  497. </div>
  498. <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>
  499. <div class="method">
  500. <div class="description">
  501. <p>Sets the size of the pass's render target. Honors the pixel ratio.</p>
  502. </div>
  503. <table class="params">
  504. <tbody>
  505. <tr>
  506. <td class="name">
  507. <strong>width</strong>
  508. </td>
  509. <td class="description last">
  510. <p>The width to set.</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 to set.</p>
  519. </td>
  520. </tr>
  521. </tbody>
  522. </table>
  523. </div>
  524. <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>
  525. <div class="method">
  526. <div class="description">
  527. <p>This method allows to define the pass's viewport. By default, the viewport is kept in sync
  528. with the pass's dimensions. To reverse the process and use auto-sizing again, call the method
  529. with <code>null</code> as the single argument.</p>
  530. </div>
  531. <table class="params">
  532. <tbody>
  533. <tr>
  534. <td class="name">
  535. <strong>x</strong>
  536. </td>
  537. <td class="description last">
  538. <p>The horizontal coordinate for the lower left corner of the viewport origin in logical pixel unit.</p>
  539. </td>
  540. </tr>
  541. <tr>
  542. <td class="name">
  543. <strong>y</strong>
  544. </td>
  545. <td class="description last">
  546. <p>The vertical coordinate for the lower left corner of the viewport origin in logical pixel unit.</p>
  547. </td>
  548. </tr>
  549. <tr>
  550. <td class="name">
  551. <strong>width</strong>
  552. </td>
  553. <td class="description last">
  554. <p>The width of the viewport in logical pixel unit.</p>
  555. </td>
  556. </tr>
  557. <tr>
  558. <td class="name">
  559. <strong>height</strong>
  560. </td>
  561. <td class="description last">
  562. <p>The height of the viewport in logical pixel unit.</p>
  563. </td>
  564. </tr>
  565. </tbody>
  566. </table>
  567. </div>
  568. <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>
  569. <div class="method">
  570. <div class="description">
  571. <p>Switches current and previous textures for the given output name.</p>
  572. </div>
  573. <table class="params">
  574. <tbody>
  575. <tr>
  576. <td class="name">
  577. <strong>name</strong>
  578. </td>
  579. <td class="description last">
  580. <p>The output name.</p>
  581. </td>
  582. </tr>
  583. </tbody>
  584. </table>
  585. </div>
  586. <h2 class="subsection-title">Source</h2>
  587. <p>
  588. <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>
  589. </p>
  590. </article>
  591. </section>
  592. <script src="../scripts/linenumber.js"></script>
  593. <script src="../scripts/page.js"></script>
  594. </body>
  595. </html>
粤ICP备19079148号