Info.html 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  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>frameCalls</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. </tbody>
  124. </table>
  125. </div>
  126. <div class="member">
  127. <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>
  128. <div class="description">
  129. <p>Render related metrics.</p>
  130. </div>
  131. <table class="props">
  132. <tbody>
  133. <tr>
  134. <td class="name">
  135. <strong>calls</strong>
  136. <br>
  137. <span class="param-type">number</span>
  138. </td>
  139. <td class="description last">
  140. <p>The number of render calls since the app has been started.</p>
  141. </td>
  142. </tr>
  143. <tr>
  144. <td class="name">
  145. <strong>frameCalls</strong>
  146. <br>
  147. <span class="param-type">number</span>
  148. </td>
  149. <td class="description last">
  150. <p>The number of render calls of the current frame.</p>
  151. </td>
  152. </tr>
  153. <tr>
  154. <td class="name">
  155. <strong>drawCalls</strong>
  156. <br>
  157. <span class="param-type">number</span>
  158. </td>
  159. <td class="description last">
  160. <p>The number of draw calls of the current frame.</p>
  161. </td>
  162. </tr>
  163. <tr>
  164. <td class="name">
  165. <strong>triangles</strong>
  166. <br>
  167. <span class="param-type">number</span>
  168. </td>
  169. <td class="description last">
  170. <p>The number of rendered triangle primitives of the current frame.</p>
  171. </td>
  172. </tr>
  173. <tr>
  174. <td class="name">
  175. <strong>points</strong>
  176. <br>
  177. <span class="param-type">number</span>
  178. </td>
  179. <td class="description last">
  180. <p>The number of rendered point primitives of the current frame.</p>
  181. </td>
  182. </tr>
  183. <tr>
  184. <td class="name">
  185. <strong>lines</strong>
  186. <br>
  187. <span class="param-type">number</span>
  188. </td>
  189. <td class="description last">
  190. <p>The number of rendered line primitives of the current frame.</p>
  191. </td>
  192. </tr>
  193. <tr>
  194. <td class="name">
  195. <strong>timestamp</strong>
  196. <br>
  197. <span class="param-type">number</span>
  198. </td>
  199. <td class="description last">
  200. <p>The timestamp of the frame.</p>
  201. </td>
  202. </tr>
  203. </tbody>
  204. </table>
  205. </div>
  206. <h2 class="subsection-title">Methods</h2>
  207. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  208. <div class="method">
  209. <div class="description">
  210. <p>Performs a complete reset of the object.</p>
  211. </div>
  212. </div>
  213. <h3 class="name name-method" id="reset" translate="no">.<a href="#reset">reset</a><span class="signature">()</span> </h3>
  214. <div class="method">
  215. <div class="description">
  216. <p>Resets frame related metrics.</p>
  217. </div>
  218. </div>
  219. <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>
  220. <div class="method">
  221. <div class="description">
  222. <p>This method should be executed per draw call and updates the corresponding metrics.</p>
  223. </div>
  224. <table class="params">
  225. <tbody>
  226. <tr>
  227. <td class="name">
  228. <strong>object</strong>
  229. </td>
  230. <td class="description last">
  231. <p>The 3D object that is going to be rendered.</p>
  232. </td>
  233. </tr>
  234. <tr>
  235. <td class="name">
  236. <strong>count</strong>
  237. </td>
  238. <td class="description last">
  239. <p>The vertex or index count.</p>
  240. </td>
  241. </tr>
  242. <tr>
  243. <td class="name">
  244. <strong>instanceCount</strong>
  245. </td>
  246. <td class="description last">
  247. <p>The instance count.</p>
  248. </td>
  249. </tr>
  250. </tbody>
  251. </table>
  252. </div>
  253. <h2 class="subsection-title">Source</h2>
  254. <p>
  255. <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>
  256. </p>
  257. </article>
  258. </section>
  259. <script src="../scripts/linenumber.js"></script>
  260. <script src="../scripts/page.js"></script>
  261. </body>
  262. </html>
粤ICP备19079148号