Info.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Info - 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. <h1 translate="no">Info</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>This renderer module provides a series of statistical information
  16. about the GPU memory and the rendering process. Useful for debugging
  17. and monitoring.</p></div>
  18. </header>
  19. <article>
  20. <div class="container-overview">
  21. <h2>Constructor</h2>
  22. <h3 class="name name-method" id="Info" translate="no">new <a href="#Info">Info</a><span class="signature">()</span> </h3>
  23. <div class="method">
  24. <div class="description">
  25. <p>Constructs a new info component.</p>
  26. </div>
  27. </div>
  28. </div>
  29. <h2 class="subsection-title">Properties</h2>
  30. <div class="member">
  31. <h3 class="name" id="autoReset" translate="no">.<a href="#autoReset">autoReset</a><span class="type-signature"> : boolean</span> </h3>
  32. <div class="description">
  33. <p>Whether frame related metrics should automatically
  34. be resetted or not. This property should be set to <code>false</code>
  35. by apps which manage their own animation loop. They must
  36. then call <code>renderer.info.reset()</code> once per frame manually.</p>
  37. <p>Default is <code>true</code>.</p>
  38. </div>
  39. </div>
  40. <div class="member">
  41. <h3 class="name" id="calls" translate="no">.<a href="#calls">calls</a><span class="type-signature"> : number</span> <span class="type-signature">(readonly) </span></h3>
  42. <div class="description">
  43. <p>The number of render calls since the
  44. app has been started.</p>
  45. <p>Default is <code>0</code>.</p>
  46. </div>
  47. </div>
  48. <div class="member">
  49. <h3 class="name" id="compute" translate="no">.<a href="#compute">compute</a><span class="type-signature"> : Object</span> <span class="type-signature">(readonly) </span></h3>
  50. <div class="description">
  51. <p>Compute related metrics.</p>
  52. </div>
  53. <table class="props">
  54. <tbody>
  55. <tr>
  56. <td class="name">
  57. <strong>calls</strong>
  58. <br>
  59. <span class="param-type">number</span>
  60. </td>
  61. <td class="description last">
  62. <p>The number of compute calls since the app has been started.</p>
  63. </td>
  64. </tr>
  65. <tr>
  66. <td class="name">
  67. <strong>frameCalls</strong>
  68. <br>
  69. <span class="param-type">number</span>
  70. </td>
  71. <td class="description last">
  72. <p>The number of compute calls of the current frame.</p>
  73. </td>
  74. </tr>
  75. <tr>
  76. <td class="name">
  77. <strong>timestamp</strong>
  78. <br>
  79. <span class="param-type">number</span>
  80. </td>
  81. <td class="description last">
  82. <p>The timestamp of the frame when using <code>renderer.computeAsync()</code>.</p>
  83. </td>
  84. </tr>
  85. </tbody>
  86. </table>
  87. </div>
  88. <div class="member">
  89. <h3 class="name" id="frame" translate="no">.<a href="#frame">frame</a><span class="type-signature"> : number</span> <span class="type-signature">(readonly) </span></h3>
  90. <div class="description">
  91. <p>The current frame ID. This ID is managed
  92. by <code>NodeFrame</code>.</p>
  93. <p>Default is <code>0</code>.</p>
  94. </div>
  95. </div>
  96. <div class="member">
  97. <h3 class="name" id="memory" translate="no">.<a href="#memory">memory</a><span class="type-signature"> : Object</span> <span class="type-signature">(readonly) </span></h3>
  98. <div class="description">
  99. <p>Memory related metrics.</p>
  100. </div>
  101. <table class="props">
  102. <tbody>
  103. <tr>
  104. <td class="name">
  105. <strong>geometries</strong>
  106. <br>
  107. <span class="param-type">number</span>
  108. </td>
  109. <td class="description last">
  110. <p>The number of active geometries.</p>
  111. </td>
  112. </tr>
  113. <tr>
  114. <td class="name">
  115. <strong>textures</strong>
  116. <br>
  117. <span class="param-type">number</span>
  118. </td>
  119. <td class="description last">
  120. <p>The number of active textures.</p>
  121. </td>
  122. </tr>
  123. <tr>
  124. <td class="name">
  125. <strong>attributes</strong>
  126. <br>
  127. <span class="param-type">number</span>
  128. </td>
  129. <td class="description last">
  130. <p>The number of active attributes.</p>
  131. </td>
  132. </tr>
  133. <tr>
  134. <td class="name">
  135. <strong>indexAttributes</strong>
  136. <br>
  137. <span class="param-type">number</span>
  138. </td>
  139. <td class="description last">
  140. <p>The number of active index attributes.</p>
  141. </td>
  142. </tr>
  143. <tr>
  144. <td class="name">
  145. <strong>storageAttributes</strong>
  146. <br>
  147. <span class="param-type">number</span>
  148. </td>
  149. <td class="description last">
  150. <p>The number of active storage attributes.</p>
  151. </td>
  152. </tr>
  153. <tr>
  154. <td class="name">
  155. <strong>indirectStorageAttributes</strong>
  156. <br>
  157. <span class="param-type">number</span>
  158. </td>
  159. <td class="description last">
  160. <p>The number of active indirect storage attributes.</p>
  161. </td>
  162. </tr>
  163. <tr>
  164. <td class="name">
  165. <strong>readbackBuffers</strong>
  166. <br>
  167. <span class="param-type">number</span>
  168. </td>
  169. <td class="description last">
  170. <p>The number of active readback buffers.</p>
  171. </td>
  172. </tr>
  173. <tr>
  174. <td class="name">
  175. <strong>programs</strong>
  176. <br>
  177. <span class="param-type">number</span>
  178. </td>
  179. <td class="description last">
  180. <p>The number of active programs.</p>
  181. </td>
  182. </tr>
  183. <tr>
  184. <td class="name">
  185. <strong>renderTargets</strong>
  186. <br>
  187. <span class="param-type">number</span>
  188. </td>
  189. <td class="description last">
  190. <p>The number of active renderTargets.</p>
  191. </td>
  192. </tr>
  193. <tr>
  194. <td class="name">
  195. <strong>total</strong>
  196. <br>
  197. <span class="param-type">number</span>
  198. </td>
  199. <td class="description last">
  200. <p>The total memory size in bytes.</p>
  201. </td>
  202. </tr>
  203. <tr>
  204. <td class="name">
  205. <strong>texturesSize</strong>
  206. <br>
  207. <span class="param-type">number</span>
  208. </td>
  209. <td class="description last">
  210. <p>The memory size of active textures in bytes.</p>
  211. </td>
  212. </tr>
  213. <tr>
  214. <td class="name">
  215. <strong>attributesSize</strong>
  216. <br>
  217. <span class="param-type">number</span>
  218. </td>
  219. <td class="description last">
  220. <p>The memory size of active attributes in bytes.</p>
  221. </td>
  222. </tr>
  223. <tr>
  224. <td class="name">
  225. <strong>indexAttributesSize</strong>
  226. <br>
  227. <span class="param-type">number</span>
  228. </td>
  229. <td class="description last">
  230. <p>The memory size of active index attributes in bytes.</p>
  231. </td>
  232. </tr>
  233. <tr>
  234. <td class="name">
  235. <strong>storageAttributesSize</strong>
  236. <br>
  237. <span class="param-type">number</span>
  238. </td>
  239. <td class="description last">
  240. <p>The memory size of active storage attributes in bytes.</p>
  241. </td>
  242. </tr>
  243. <tr>
  244. <td class="name">
  245. <strong>indirectStorageAttributesSize</strong>
  246. <br>
  247. <span class="param-type">number</span>
  248. </td>
  249. <td class="description last">
  250. <p>The memory size of active indirect storage attributes in bytes.</p>
  251. </td>
  252. </tr>
  253. <tr>
  254. <td class="name">
  255. <strong>readbackBuffersSize</strong>
  256. <br>
  257. <span class="param-type">number</span>
  258. </td>
  259. <td class="description last">
  260. <p>The memory size of active readback buffers in bytes.</p>
  261. </td>
  262. </tr>
  263. <tr>
  264. <td class="name">
  265. <strong>programsSize</strong>
  266. <br>
  267. <span class="param-type">number</span>
  268. </td>
  269. <td class="description last">
  270. <p>The memory size of active programs in bytes.</p>
  271. </td>
  272. </tr>
  273. </tbody>
  274. </table>
  275. </div>
  276. <div class="member">
  277. <h3 class="name" id="render" translate="no">.<a href="#render">render</a><span class="type-signature"> : Object</span> <span class="type-signature">(readonly) </span></h3>
  278. <div class="description">
  279. <p>Render related metrics.</p>
  280. </div>
  281. <table class="props">
  282. <tbody>
  283. <tr>
  284. <td class="name">
  285. <strong>calls</strong>
  286. <br>
  287. <span class="param-type">number</span>
  288. </td>
  289. <td class="description last">
  290. <p>The number of render calls since the app has been started.</p>
  291. </td>
  292. </tr>
  293. <tr>
  294. <td class="name">
  295. <strong>frameCalls</strong>
  296. <br>
  297. <span class="param-type">number</span>
  298. </td>
  299. <td class="description last">
  300. <p>The number of render calls of the current frame.</p>
  301. </td>
  302. </tr>
  303. <tr>
  304. <td class="name">
  305. <strong>drawCalls</strong>
  306. <br>
  307. <span class="param-type">number</span>
  308. </td>
  309. <td class="description last">
  310. <p>The number of draw calls of the current frame.</p>
  311. </td>
  312. </tr>
  313. <tr>
  314. <td class="name">
  315. <strong>triangles</strong>
  316. <br>
  317. <span class="param-type">number</span>
  318. </td>
  319. <td class="description last">
  320. <p>The number of rendered triangle primitives of the current frame.</p>
  321. </td>
  322. </tr>
  323. <tr>
  324. <td class="name">
  325. <strong>points</strong>
  326. <br>
  327. <span class="param-type">number</span>
  328. </td>
  329. <td class="description last">
  330. <p>The number of rendered point primitives of the current frame.</p>
  331. </td>
  332. </tr>
  333. <tr>
  334. <td class="name">
  335. <strong>lines</strong>
  336. <br>
  337. <span class="param-type">number</span>
  338. </td>
  339. <td class="description last">
  340. <p>The number of rendered line primitives of the current frame.</p>
  341. </td>
  342. </tr>
  343. <tr>
  344. <td class="name">
  345. <strong>timestamp</strong>
  346. <br>
  347. <span class="param-type">number</span>
  348. </td>
  349. <td class="description last">
  350. <p>The timestamp of the frame.</p>
  351. </td>
  352. </tr>
  353. </tbody>
  354. </table>
  355. </div>
  356. <h2 class="subsection-title">Methods</h2>
  357. <h3 class="name name-method" id="createAttribute" translate="no">.<a href="#createAttribute">createAttribute</a><span class="signature">( attribute : <span class="param-type"><a href="BufferAttribute.html">BufferAttribute</a></span> )</span> </h3>
  358. <div class="method">
  359. <div class="description">
  360. <p>Tracks a regular attribute memory explicitly.</p>
  361. </div>
  362. <table class="params">
  363. <tbody>
  364. <tr>
  365. <td class="name">
  366. <strong translate="no">attribute</strong>
  367. </td>
  368. <td class="description last">
  369. <p>The attribute to track.</p>
  370. </td>
  371. </tr>
  372. </tbody>
  373. </table>
  374. </div>
  375. <h3 class="name name-method" id="createIndexAttribute" translate="no">.<a href="#createIndexAttribute">createIndexAttribute</a><span class="signature">( attribute : <span class="param-type"><a href="BufferAttribute.html">BufferAttribute</a></span> )</span> </h3>
  376. <div class="method">
  377. <div class="description">
  378. <p>Tracks an index attribute memory explicitly.</p>
  379. </div>
  380. <table class="params">
  381. <tbody>
  382. <tr>
  383. <td class="name">
  384. <strong translate="no">attribute</strong>
  385. </td>
  386. <td class="description last">
  387. <p>The index attribute to track.</p>
  388. </td>
  389. </tr>
  390. </tbody>
  391. </table>
  392. </div>
  393. <h3 class="name name-method" id="createIndirectStorageAttribute" translate="no">.<a href="#createIndirectStorageAttribute">createIndirectStorageAttribute</a><span class="signature">( attribute : <span class="param-type"><a href="BufferAttribute.html">BufferAttribute</a></span> )</span> </h3>
  394. <div class="method">
  395. <div class="description">
  396. <p>Tracks an indirect storage attribute memory explicitly.</p>
  397. </div>
  398. <table class="params">
  399. <tbody>
  400. <tr>
  401. <td class="name">
  402. <strong translate="no">attribute</strong>
  403. </td>
  404. <td class="description last">
  405. <p>The indirect storage attribute to track.</p>
  406. </td>
  407. </tr>
  408. </tbody>
  409. </table>
  410. </div>
  411. <h3 class="name name-method" id="createProgram" translate="no">.<a href="#createProgram">createProgram</a><span class="signature">( program : <span class="param-type"><a href="ProgrammableStage.html">ProgrammableStage</a></span> )</span> </h3>
  412. <div class="method">
  413. <div class="description">
  414. <p>Tracks program memory explicitly, updating counts and byte tracking.</p>
  415. </div>
  416. <table class="params">
  417. <tbody>
  418. <tr>
  419. <td class="name">
  420. <strong translate="no">program</strong>
  421. </td>
  422. <td class="description last">
  423. <p>The program to track.</p>
  424. </td>
  425. </tr>
  426. </tbody>
  427. </table>
  428. </div>
  429. <h3 class="name name-method" id="createReadbackBuffer" translate="no">.<a href="#createReadbackBuffer">createReadbackBuffer</a><span class="signature">( readbackBuffer : <span class="param-type"><a href="ReadbackBuffer.html">ReadbackBuffer</a></span> )</span> </h3>
  430. <div class="method">
  431. <div class="description">
  432. <p>Tracks a readback buffer memory explicitly.</p>
  433. </div>
  434. <table class="params">
  435. <tbody>
  436. <tr>
  437. <td class="name">
  438. <strong translate="no">readbackBuffer</strong>
  439. </td>
  440. <td class="description last">
  441. <p>The readback buffer to track.</p>
  442. </td>
  443. </tr>
  444. </tbody>
  445. </table>
  446. </div>
  447. <h3 class="name name-method" id="createStorageAttribute" translate="no">.<a href="#createStorageAttribute">createStorageAttribute</a><span class="signature">( attribute : <span class="param-type"><a href="BufferAttribute.html">BufferAttribute</a></span> )</span> </h3>
  448. <div class="method">
  449. <div class="description">
  450. <p>Tracks a storage attribute memory explicitly.</p>
  451. </div>
  452. <table class="params">
  453. <tbody>
  454. <tr>
  455. <td class="name">
  456. <strong translate="no">attribute</strong>
  457. </td>
  458. <td class="description last">
  459. <p>The storage attribute to track.</p>
  460. </td>
  461. </tr>
  462. </tbody>
  463. </table>
  464. </div>
  465. <h3 class="name name-method" id="createTexture" translate="no">.<a href="#createTexture">createTexture</a><span class="signature">( texture : <span class="param-type"><a href="Texture.html">Texture</a></span> )</span> </h3>
  466. <div class="method">
  467. <div class="description">
  468. <p>Tracks texture memory explicitly, updating counts and byte tracking.</p>
  469. </div>
  470. <table class="params">
  471. <tbody>
  472. <tr>
  473. <td class="name">
  474. <strong translate="no">texture</strong>
  475. </td>
  476. <td class="description last">
  477. </td>
  478. </tr>
  479. </tbody>
  480. </table>
  481. </div>
  482. <h3 class="name name-method" id="destroyAttribute" translate="no">.<a href="#destroyAttribute">destroyAttribute</a><span class="signature">( attribute : <span class="param-type"><a href="BufferAttribute.html">BufferAttribute</a></span> )</span> </h3>
  483. <div class="method">
  484. <div class="description">
  485. <p>Tracks attribute memory explicitly, updating counts and byte tracking.</p>
  486. </div>
  487. <table class="params">
  488. <tbody>
  489. <tr>
  490. <td class="name">
  491. <strong translate="no">attribute</strong>
  492. </td>
  493. <td class="description last">
  494. </td>
  495. </tr>
  496. </tbody>
  497. </table>
  498. </div>
  499. <h3 class="name name-method" id="destroyProgram" translate="no">.<a href="#destroyProgram">destroyProgram</a><span class="signature">( program : <span class="param-type">Object</span> )</span> </h3>
  500. <div class="method">
  501. <div class="description">
  502. <p>Tracks program memory explicitly, updating counts and byte tracking.</p>
  503. </div>
  504. <table class="params">
  505. <tbody>
  506. <tr>
  507. <td class="name">
  508. <strong translate="no">program</strong>
  509. </td>
  510. <td class="description last">
  511. <p>The program to track.</p>
  512. </td>
  513. </tr>
  514. </tbody>
  515. </table>
  516. </div>
  517. <h3 class="name name-method" id="destroyReadbackBuffer" translate="no">.<a href="#destroyReadbackBuffer">destroyReadbackBuffer</a><span class="signature">( readbackBuffer : <span class="param-type"><a href="ReadbackBuffer.html">ReadbackBuffer</a></span> )</span> </h3>
  518. <div class="method">
  519. <div class="description">
  520. <p>Tracks a readback buffer memory explicitly.</p>
  521. </div>
  522. <table class="params">
  523. <tbody>
  524. <tr>
  525. <td class="name">
  526. <strong translate="no">readbackBuffer</strong>
  527. </td>
  528. <td class="description last">
  529. <p>The readback buffer to track.</p>
  530. </td>
  531. </tr>
  532. </tbody>
  533. </table>
  534. </div>
  535. <h3 class="name name-method" id="destroyTexture" translate="no">.<a href="#destroyTexture">destroyTexture</a><span class="signature">( texture : <span class="param-type"><a href="Texture.html">Texture</a></span> )</span> </h3>
  536. <div class="method">
  537. <div class="description">
  538. <p>Tracks texture memory explicitly, updating counts and byte tracking.</p>
  539. </div>
  540. <table class="params">
  541. <tbody>
  542. <tr>
  543. <td class="name">
  544. <strong translate="no">texture</strong>
  545. </td>
  546. <td class="description last">
  547. </td>
  548. </tr>
  549. </tbody>
  550. </table>
  551. </div>
  552. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  553. <div class="method">
  554. <div class="description">
  555. <p>Performs a complete reset of the object.</p>
  556. </div>
  557. </div>
  558. <h3 class="name name-method" id="reset" translate="no">.<a href="#reset">reset</a><span class="signature">()</span> </h3>
  559. <div class="method">
  560. <div class="description">
  561. <p>Resets frame related metrics.</p>
  562. </div>
  563. </div>
  564. <h3 class="name name-method" id="update" translate="no">.<a href="#update">update</a><span class="signature">( object : <span class="param-type"><a href="Object3D.html">Object3D</a></span>, count : <span class="param-type">number</span>, instanceCount : <span class="param-type">number</span> )</span> </h3>
  565. <div class="method">
  566. <div class="description">
  567. <p>This method should be executed per draw call and updates the corresponding metrics.</p>
  568. </div>
  569. <table class="params">
  570. <tbody>
  571. <tr>
  572. <td class="name">
  573. <strong translate="no">object</strong>
  574. </td>
  575. <td class="description last">
  576. <p>The 3D object that is going to be rendered.</p>
  577. </td>
  578. </tr>
  579. <tr>
  580. <td class="name">
  581. <strong translate="no">count</strong>
  582. </td>
  583. <td class="description last">
  584. <p>The vertex or index count.</p>
  585. </td>
  586. </tr>
  587. <tr>
  588. <td class="name">
  589. <strong translate="no">instanceCount</strong>
  590. </td>
  591. <td class="description last">
  592. <p>The instance count.</p>
  593. </td>
  594. </tr>
  595. </tbody>
  596. </table>
  597. </div>
  598. <h2 class="subsection-title">Source</h2>
  599. <p>
  600. <a href="https://github.com/mrdoob/three.js/blob/master/src/renderers/common/Info.js" translate="no" target="_blank" rel="noopener">src/renderers/common/Info.js</a>
  601. </p>
  602. </article>
  603. </section>
  604. <script src="../scripts/linenumber.js"></script>
  605. <script src="../scripts/page.js"></script>
  606. </body>
  607. </html>
粤ICP备19079148号