Info.html 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663
  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>attributes</strong>
  106. <br>
  107. <span class="param-type">number</span>
  108. </td>
  109. <td class="description last">
  110. <p>The number of active attributes.</p>
  111. </td>
  112. </tr>
  113. <tr>
  114. <td class="name">
  115. <strong>attributesSize</strong>
  116. <br>
  117. <span class="param-type">number</span>
  118. </td>
  119. <td class="description last">
  120. <p>The memory size of active attributes in bytes.</p>
  121. </td>
  122. </tr>
  123. <tr>
  124. <td class="name">
  125. <strong>geometries</strong>
  126. <br>
  127. <span class="param-type">number</span>
  128. </td>
  129. <td class="description last">
  130. <p>The number of active geometries.</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>indexAttributesSize</strong>
  146. <br>
  147. <span class="param-type">number</span>
  148. </td>
  149. <td class="description last">
  150. <p>The memory size of active index attributes in bytes.</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>indirectStorageAttributesSize</strong>
  166. <br>
  167. <span class="param-type">number</span>
  168. </td>
  169. <td class="description last">
  170. <p>The memory size of active indirect storage attributes in bytes.</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>programsSize</strong>
  186. <br>
  187. <span class="param-type">number</span>
  188. </td>
  189. <td class="description last">
  190. <p>The memory size of active programs in bytes.</p>
  191. </td>
  192. </tr>
  193. <tr>
  194. <td class="name">
  195. <strong>readbackBuffers</strong>
  196. <br>
  197. <span class="param-type">number</span>
  198. </td>
  199. <td class="description last">
  200. <p>The number of active readback buffers.</p>
  201. </td>
  202. </tr>
  203. <tr>
  204. <td class="name">
  205. <strong>readbackBuffersSize</strong>
  206. <br>
  207. <span class="param-type">number</span>
  208. </td>
  209. <td class="description last">
  210. <p>The memory size of active readback buffers in bytes.</p>
  211. </td>
  212. </tr>
  213. <tr>
  214. <td class="name">
  215. <strong>renderTargets</strong>
  216. <br>
  217. <span class="param-type">number</span>
  218. </td>
  219. <td class="description last">
  220. <p>The number of active renderTargets.</p>
  221. </td>
  222. </tr>
  223. <tr>
  224. <td class="name">
  225. <strong>storageAttributes</strong>
  226. <br>
  227. <span class="param-type">number</span>
  228. </td>
  229. <td class="description last">
  230. <p>The number of active storage attributes.</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>textures</strong>
  246. <br>
  247. <span class="param-type">number</span>
  248. </td>
  249. <td class="description last">
  250. <p>The number of active textures.</p>
  251. </td>
  252. </tr>
  253. <tr>
  254. <td class="name">
  255. <strong>texturesSize</strong>
  256. <br>
  257. <span class="param-type">number</span>
  258. </td>
  259. <td class="description last">
  260. <p>The memory size of active textures in bytes.</p>
  261. </td>
  262. </tr>
  263. <tr>
  264. <td class="name">
  265. <strong>uniformBuffers</strong>
  266. <br>
  267. <span class="param-type">number</span>
  268. </td>
  269. <td class="description last">
  270. <p>The number of active uniform buffers.</p>
  271. </td>
  272. </tr>
  273. <tr>
  274. <td class="name">
  275. <strong>uniformBuffersSize</strong>
  276. <br>
  277. <span class="param-type">number</span>
  278. </td>
  279. <td class="description last">
  280. <p>The memory size of active uniform buffers in bytes.</p>
  281. </td>
  282. </tr>
  283. <tr>
  284. <td class="name">
  285. <strong>total</strong>
  286. <br>
  287. <span class="param-type">number</span>
  288. </td>
  289. <td class="description last">
  290. <p>The total memory size in bytes.</p>
  291. </td>
  292. </tr>
  293. </tbody>
  294. </table>
  295. </div>
  296. <div class="member">
  297. <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>
  298. <div class="description">
  299. <p>Render related metrics.</p>
  300. </div>
  301. <table class="props">
  302. <tbody>
  303. <tr>
  304. <td class="name">
  305. <strong>calls</strong>
  306. <br>
  307. <span class="param-type">number</span>
  308. </td>
  309. <td class="description last">
  310. <p>The number of render calls since the app has been started.</p>
  311. </td>
  312. </tr>
  313. <tr>
  314. <td class="name">
  315. <strong>frameCalls</strong>
  316. <br>
  317. <span class="param-type">number</span>
  318. </td>
  319. <td class="description last">
  320. <p>The number of render calls of the current frame.</p>
  321. </td>
  322. </tr>
  323. <tr>
  324. <td class="name">
  325. <strong>drawCalls</strong>
  326. <br>
  327. <span class="param-type">number</span>
  328. </td>
  329. <td class="description last">
  330. <p>The number of draw calls of the current frame.</p>
  331. </td>
  332. </tr>
  333. <tr>
  334. <td class="name">
  335. <strong>triangles</strong>
  336. <br>
  337. <span class="param-type">number</span>
  338. </td>
  339. <td class="description last">
  340. <p>The number of rendered triangle primitives of the current frame.</p>
  341. </td>
  342. </tr>
  343. <tr>
  344. <td class="name">
  345. <strong>points</strong>
  346. <br>
  347. <span class="param-type">number</span>
  348. </td>
  349. <td class="description last">
  350. <p>The number of rendered point primitives of the current frame.</p>
  351. </td>
  352. </tr>
  353. <tr>
  354. <td class="name">
  355. <strong>lines</strong>
  356. <br>
  357. <span class="param-type">number</span>
  358. </td>
  359. <td class="description last">
  360. <p>The number of rendered line primitives of the current frame.</p>
  361. </td>
  362. </tr>
  363. <tr>
  364. <td class="name">
  365. <strong>timestamp</strong>
  366. <br>
  367. <span class="param-type">number</span>
  368. </td>
  369. <td class="description last">
  370. <p>The timestamp of the frame.</p>
  371. </td>
  372. </tr>
  373. </tbody>
  374. </table>
  375. </div>
  376. <h2 class="subsection-title">Methods</h2>
  377. <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>
  378. <div class="method">
  379. <div class="description">
  380. <p>Tracks a regular attribute memory explicitly.</p>
  381. </div>
  382. <table class="params">
  383. <tbody>
  384. <tr>
  385. <td class="name">
  386. <strong translate="no">attribute</strong>
  387. </td>
  388. <td class="description last">
  389. <p>The attribute to track.</p>
  390. </td>
  391. </tr>
  392. </tbody>
  393. </table>
  394. </div>
  395. <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>
  396. <div class="method">
  397. <div class="description">
  398. <p>Tracks an index attribute memory explicitly.</p>
  399. </div>
  400. <table class="params">
  401. <tbody>
  402. <tr>
  403. <td class="name">
  404. <strong translate="no">attribute</strong>
  405. </td>
  406. <td class="description last">
  407. <p>The index attribute to track.</p>
  408. </td>
  409. </tr>
  410. </tbody>
  411. </table>
  412. </div>
  413. <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>
  414. <div class="method">
  415. <div class="description">
  416. <p>Tracks an indirect storage attribute memory explicitly.</p>
  417. </div>
  418. <table class="params">
  419. <tbody>
  420. <tr>
  421. <td class="name">
  422. <strong translate="no">attribute</strong>
  423. </td>
  424. <td class="description last">
  425. <p>The indirect storage attribute to track.</p>
  426. </td>
  427. </tr>
  428. </tbody>
  429. </table>
  430. </div>
  431. <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>
  432. <div class="method">
  433. <div class="description">
  434. <p>Tracks program memory explicitly, updating counts and byte tracking.</p>
  435. </div>
  436. <table class="params">
  437. <tbody>
  438. <tr>
  439. <td class="name">
  440. <strong translate="no">program</strong>
  441. </td>
  442. <td class="description last">
  443. <p>The program to track.</p>
  444. </td>
  445. </tr>
  446. </tbody>
  447. </table>
  448. </div>
  449. <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>
  450. <div class="method">
  451. <div class="description">
  452. <p>Tracks a readback buffer memory explicitly.</p>
  453. </div>
  454. <table class="params">
  455. <tbody>
  456. <tr>
  457. <td class="name">
  458. <strong translate="no">readbackBuffer</strong>
  459. </td>
  460. <td class="description last">
  461. <p>The readback buffer to track.</p>
  462. </td>
  463. </tr>
  464. </tbody>
  465. </table>
  466. </div>
  467. <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>
  468. <div class="method">
  469. <div class="description">
  470. <p>Tracks a storage attribute memory explicitly.</p>
  471. </div>
  472. <table class="params">
  473. <tbody>
  474. <tr>
  475. <td class="name">
  476. <strong translate="no">attribute</strong>
  477. </td>
  478. <td class="description last">
  479. <p>The storage attribute to track.</p>
  480. </td>
  481. </tr>
  482. </tbody>
  483. </table>
  484. </div>
  485. <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>
  486. <div class="method">
  487. <div class="description">
  488. <p>Tracks texture memory explicitly, updating counts and byte tracking.</p>
  489. </div>
  490. <table class="params">
  491. <tbody>
  492. <tr>
  493. <td class="name">
  494. <strong translate="no">texture</strong>
  495. </td>
  496. <td class="description last">
  497. </td>
  498. </tr>
  499. </tbody>
  500. </table>
  501. </div>
  502. <h3 class="name name-method" id="createUniformBuffer" translate="no">.<a href="#createUniformBuffer">createUniformBuffer</a><span class="signature">( uniformBuffer : <span class="param-type"><a href="UniformBuffer.html">UniformBuffer</a></span> )</span> </h3>
  503. <div class="method">
  504. <div class="description">
  505. <p>Tracks a uniform buffer memory explicitly.</p>
  506. </div>
  507. <table class="params">
  508. <tbody>
  509. <tr>
  510. <td class="name">
  511. <strong translate="no">uniformBuffer</strong>
  512. </td>
  513. <td class="description last">
  514. <p>The uniform buffer to track.</p>
  515. </td>
  516. </tr>
  517. </tbody>
  518. </table>
  519. </div>
  520. <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>
  521. <div class="method">
  522. <div class="description">
  523. <p>Tracks attribute memory explicitly, updating counts and byte tracking.</p>
  524. </div>
  525. <table class="params">
  526. <tbody>
  527. <tr>
  528. <td class="name">
  529. <strong translate="no">attribute</strong>
  530. </td>
  531. <td class="description last">
  532. </td>
  533. </tr>
  534. </tbody>
  535. </table>
  536. </div>
  537. <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>
  538. <div class="method">
  539. <div class="description">
  540. <p>Tracks program memory explicitly, updating counts and byte tracking.</p>
  541. </div>
  542. <table class="params">
  543. <tbody>
  544. <tr>
  545. <td class="name">
  546. <strong translate="no">program</strong>
  547. </td>
  548. <td class="description last">
  549. <p>The program to track.</p>
  550. </td>
  551. </tr>
  552. </tbody>
  553. </table>
  554. </div>
  555. <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>
  556. <div class="method">
  557. <div class="description">
  558. <p>Tracks a readback buffer memory explicitly.</p>
  559. </div>
  560. <table class="params">
  561. <tbody>
  562. <tr>
  563. <td class="name">
  564. <strong translate="no">readbackBuffer</strong>
  565. </td>
  566. <td class="description last">
  567. <p>The readback buffer to track.</p>
  568. </td>
  569. </tr>
  570. </tbody>
  571. </table>
  572. </div>
  573. <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>
  574. <div class="method">
  575. <div class="description">
  576. <p>Tracks texture memory explicitly, updating counts and byte tracking.</p>
  577. </div>
  578. <table class="params">
  579. <tbody>
  580. <tr>
  581. <td class="name">
  582. <strong translate="no">texture</strong>
  583. </td>
  584. <td class="description last">
  585. </td>
  586. </tr>
  587. </tbody>
  588. </table>
  589. </div>
  590. <h3 class="name name-method" id="destroyUniformBuffer" translate="no">.<a href="#destroyUniformBuffer">destroyUniformBuffer</a><span class="signature">( uniformBuffer : <span class="param-type"><a href="UniformBuffer.html">UniformBuffer</a></span> )</span> </h3>
  591. <div class="method">
  592. <div class="description">
  593. <p>Tracks a uniform buffer memory explicitly.</p>
  594. </div>
  595. <table class="params">
  596. <tbody>
  597. <tr>
  598. <td class="name">
  599. <strong translate="no">uniformBuffer</strong>
  600. </td>
  601. <td class="description last">
  602. <p>The uniform buffer to track.</p>
  603. </td>
  604. </tr>
  605. </tbody>
  606. </table>
  607. </div>
  608. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  609. <div class="method">
  610. <div class="description">
  611. <p>Performs a complete reset of the object.</p>
  612. </div>
  613. </div>
  614. <h3 class="name name-method" id="reset" translate="no">.<a href="#reset">reset</a><span class="signature">()</span> </h3>
  615. <div class="method">
  616. <div class="description">
  617. <p>Resets frame related metrics.</p>
  618. </div>
  619. </div>
  620. <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>
  621. <div class="method">
  622. <div class="description">
  623. <p>This method should be executed per draw call and updates the corresponding metrics.</p>
  624. </div>
  625. <table class="params">
  626. <tbody>
  627. <tr>
  628. <td class="name">
  629. <strong translate="no">object</strong>
  630. </td>
  631. <td class="description last">
  632. <p>The 3D object that is going to be rendered.</p>
  633. </td>
  634. </tr>
  635. <tr>
  636. <td class="name">
  637. <strong translate="no">count</strong>
  638. </td>
  639. <td class="description last">
  640. <p>The vertex or index count.</p>
  641. </td>
  642. </tr>
  643. <tr>
  644. <td class="name">
  645. <strong translate="no">instanceCount</strong>
  646. </td>
  647. <td class="description last">
  648. <p>The instance count.</p>
  649. </td>
  650. </tr>
  651. </tbody>
  652. </table>
  653. </div>
  654. <h2 class="subsection-title">Source</h2>
  655. <p>
  656. <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>
  657. </p>
  658. </article>
  659. </section>
  660. <script src="../scripts/linenumber.js"></script>
  661. <script src="../scripts/page.js"></script>
  662. </body>
  663. </html>
粤ICP备19079148号