Info.html 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  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.<br/>Default is <code>true</code>.</p>
  37. </div>
  38. </div>
  39. <div class="member">
  40. <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>
  41. <div class="description">
  42. <p>The number of render calls since the
  43. app has been started.<br/>Default is <code>0</code>.</p>
  44. </div>
  45. </div>
  46. <div class="member">
  47. <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>
  48. <div class="description">
  49. <p>Compute related metrics.</p>
  50. </div>
  51. <h5 class="subsection-title">Properties:</h5>
  52. <table class="props">
  53. <thead>
  54. <tr>
  55. <th>Name</th>
  56. <th>Type</th>
  57. <th class="last">Description</th>
  58. </tr>
  59. </thead>
  60. <tbody>
  61. <tr>
  62. <td class="name"><code>calls</code></td>
  63. <td class="type">
  64. <span class="param-type">number</span>
  65. </td>
  66. <td class="description last"><p>The number of compute calls since the app has been started.</p></td>
  67. </tr>
  68. <tr>
  69. <td class="name"><code>frameCalls</code></td>
  70. <td class="type">
  71. <span class="param-type">number</span>
  72. </td>
  73. <td class="description last"><p>The number of compute calls of the current frame.</p></td>
  74. </tr>
  75. <tr>
  76. <td class="name"><code>timestamp</code></td>
  77. <td class="type">
  78. <span class="param-type">number</span>
  79. </td>
  80. <td class="description last"><p>The timestamp of the frame when using <code>renderer.computeAsync()</code>.</p></td>
  81. </tr>
  82. </tbody>
  83. </table>
  84. </div>
  85. <div class="member">
  86. <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>
  87. <div class="description">
  88. <p>The current frame ID. This ID is managed
  89. by <code>NodeFrame</code>.<br/>Default is <code>0</code>.</p>
  90. </div>
  91. </div>
  92. <div class="member">
  93. <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>
  94. <div class="description">
  95. <p>Memory related metrics.</p>
  96. </div>
  97. <h5 class="subsection-title">Properties:</h5>
  98. <table class="props">
  99. <thead>
  100. <tr>
  101. <th>Name</th>
  102. <th>Type</th>
  103. <th class="last">Description</th>
  104. </tr>
  105. </thead>
  106. <tbody>
  107. <tr>
  108. <td class="name"><code>geometries</code></td>
  109. <td class="type">
  110. <span class="param-type">number</span>
  111. </td>
  112. <td class="description last"><p>The number of active geometries.</p></td>
  113. </tr>
  114. <tr>
  115. <td class="name"><code>frameCalls</code></td>
  116. <td class="type">
  117. <span class="param-type">number</span>
  118. </td>
  119. <td class="description last"><p>The number of active textures.</p></td>
  120. </tr>
  121. </tbody>
  122. </table>
  123. </div>
  124. <div class="member">
  125. <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>
  126. <div class="description">
  127. <p>Render related metrics.</p>
  128. </div>
  129. <h5 class="subsection-title">Properties:</h5>
  130. <table class="props">
  131. <thead>
  132. <tr>
  133. <th>Name</th>
  134. <th>Type</th>
  135. <th class="last">Description</th>
  136. </tr>
  137. </thead>
  138. <tbody>
  139. <tr>
  140. <td class="name"><code>calls</code></td>
  141. <td class="type">
  142. <span class="param-type">number</span>
  143. </td>
  144. <td class="description last"><p>The number of render calls since the app has been started.</p></td>
  145. </tr>
  146. <tr>
  147. <td class="name"><code>frameCalls</code></td>
  148. <td class="type">
  149. <span class="param-type">number</span>
  150. </td>
  151. <td class="description last"><p>The number of render calls of the current frame.</p></td>
  152. </tr>
  153. <tr>
  154. <td class="name"><code>drawCalls</code></td>
  155. <td class="type">
  156. <span class="param-type">number</span>
  157. </td>
  158. <td class="description last"><p>The number of draw calls of the current frame.</p></td>
  159. </tr>
  160. <tr>
  161. <td class="name"><code>triangles</code></td>
  162. <td class="type">
  163. <span class="param-type">number</span>
  164. </td>
  165. <td class="description last"><p>The number of rendered triangle primitives of the current frame.</p></td>
  166. </tr>
  167. <tr>
  168. <td class="name"><code>points</code></td>
  169. <td class="type">
  170. <span class="param-type">number</span>
  171. </td>
  172. <td class="description last"><p>The number of rendered point primitives of the current frame.</p></td>
  173. </tr>
  174. <tr>
  175. <td class="name"><code>lines</code></td>
  176. <td class="type">
  177. <span class="param-type">number</span>
  178. </td>
  179. <td class="description last"><p>The number of rendered line primitives of the current frame.</p></td>
  180. </tr>
  181. <tr>
  182. <td class="name"><code>timestamp</code></td>
  183. <td class="type">
  184. <span class="param-type">number</span>
  185. </td>
  186. <td class="description last"><p>The timestamp of the frame.</p></td>
  187. </tr>
  188. </tbody>
  189. </table>
  190. </div>
  191. <h2 class="subsection-title">Methods</h2>
  192. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  193. <div class="method">
  194. <div class="description">
  195. <p>Performs a complete reset of the object.</p>
  196. </div>
  197. </div>
  198. <h3 class="name name-method" id="reset" translate="no">.<a href="#reset">reset</a><span class="signature">()</span> </h3>
  199. <div class="method">
  200. <div class="description">
  201. <p>Resets frame related metrics.</p>
  202. </div>
  203. </div>
  204. <h3 class="name name-method" id="update" translate="no">.<a href="#update">update</a><span class="signature">( object : <span class="param-type">Object3D</span>, count : <span class="param-type">number</span>, instanceCount : <span class="param-type">number</span> )</span> </h3>
  205. <div class="method">
  206. <div class="description">
  207. <p>This method should be executed per draw call and updates the corresponding metrics.</p>
  208. </div>
  209. <table class="params">
  210. <tbody>
  211. <tr>
  212. <td class="name"><code>object</code></td>
  213. <td class="description last"><p>The 3D object that is going to be rendered.</p></td>
  214. </tr>
  215. <tr>
  216. <td class="name"><code>count</code></td>
  217. <td class="description last"><p>The vertex or index count.</p></td>
  218. </tr>
  219. <tr>
  220. <td class="name"><code>instanceCount</code></td>
  221. <td class="description last"><p>The instance count.</p></td>
  222. </tr>
  223. </tbody>
  224. </table>
  225. </div>
  226. <h2 class="subsection-title">Source</h2>
  227. <p>
  228. <a href="https://github.com/mrdoob/three.js/blob/master/src/renderers/common/Info.js" target="_blank" rel="noopener" translate="no">src/renderers/common/Info.js</a>
  229. </p>
  230. </article>
  231. </section>
  232. <script src="../scripts/linenumber.js"></script>
  233. <script src="../scripts/page.js"></script>
  234. </body>
  235. </html>
粤ICP备19079148号