sceneInstrumentation.d.ts 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. import type { Scene, IDisposable } from "../scene";
  2. import { PerfCounter } from "../Misc/perfCounter";
  3. /**
  4. * This class can be used to get instrumentation data from a Babylon engine
  5. * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#sceneinstrumentation
  6. */
  7. export declare class SceneInstrumentation implements IDisposable {
  8. /**
  9. * Defines the scene to instrument
  10. */
  11. scene: Scene;
  12. private _captureActiveMeshesEvaluationTime;
  13. private _activeMeshesEvaluationTime;
  14. private _captureRenderTargetsRenderTime;
  15. private _renderTargetsRenderTime;
  16. private _captureFrameTime;
  17. private _frameTime;
  18. private _captureRenderTime;
  19. private _renderTime;
  20. private _captureInterFrameTime;
  21. private _interFrameTime;
  22. private _captureParticlesRenderTime;
  23. private _particlesRenderTime;
  24. private _captureSpritesRenderTime;
  25. private _spritesRenderTime;
  26. private _capturePhysicsTime;
  27. private _physicsTime;
  28. private _captureAnimationsTime;
  29. private _animationsTime;
  30. private _captureCameraRenderTime;
  31. private _cameraRenderTime;
  32. private _onBeforeActiveMeshesEvaluationObserver;
  33. private _onAfterActiveMeshesEvaluationObserver;
  34. private _onBeforeRenderTargetsRenderObserver;
  35. private _onAfterRenderTargetsRenderObserver;
  36. private _onAfterRenderObserver;
  37. private _onBeforeDrawPhaseObserver;
  38. private _onAfterDrawPhaseObserver;
  39. private _onBeforeAnimationsObserver;
  40. private _onBeforeParticlesRenderingObserver;
  41. private _onAfterParticlesRenderingObserver;
  42. private _onBeforeSpritesRenderingObserver;
  43. private _onAfterSpritesRenderingObserver;
  44. private _onBeforePhysicsObserver;
  45. private _onAfterPhysicsObserver;
  46. private _onAfterAnimationsObserver;
  47. private _onBeforeCameraRenderObserver;
  48. private _onAfterCameraRenderObserver;
  49. /**
  50. * Gets the perf counter used for active meshes evaluation time
  51. */
  52. get activeMeshesEvaluationTimeCounter(): PerfCounter;
  53. /**
  54. * Gets the active meshes evaluation time capture status
  55. */
  56. get captureActiveMeshesEvaluationTime(): boolean;
  57. /**
  58. * Enable or disable the active meshes evaluation time capture
  59. */
  60. set captureActiveMeshesEvaluationTime(value: boolean);
  61. /**
  62. * Gets the perf counter used for render targets render time
  63. */
  64. get renderTargetsRenderTimeCounter(): PerfCounter;
  65. /**
  66. * Gets the render targets render time capture status
  67. */
  68. get captureRenderTargetsRenderTime(): boolean;
  69. /**
  70. * Enable or disable the render targets render time capture
  71. */
  72. set captureRenderTargetsRenderTime(value: boolean);
  73. /**
  74. * Gets the perf counter used for particles render time
  75. */
  76. get particlesRenderTimeCounter(): PerfCounter;
  77. /**
  78. * Gets the particles render time capture status
  79. */
  80. get captureParticlesRenderTime(): boolean;
  81. /**
  82. * Enable or disable the particles render time capture
  83. */
  84. set captureParticlesRenderTime(value: boolean);
  85. /**
  86. * Gets the perf counter used for sprites render time
  87. */
  88. get spritesRenderTimeCounter(): PerfCounter;
  89. /**
  90. * Gets the sprites render time capture status
  91. */
  92. get captureSpritesRenderTime(): boolean;
  93. /**
  94. * Enable or disable the sprites render time capture
  95. */
  96. set captureSpritesRenderTime(value: boolean);
  97. /**
  98. * Gets the perf counter used for physics time
  99. */
  100. get physicsTimeCounter(): PerfCounter;
  101. /**
  102. * Gets the physics time capture status
  103. */
  104. get capturePhysicsTime(): boolean;
  105. /**
  106. * Enable or disable the physics time capture
  107. */
  108. set capturePhysicsTime(value: boolean);
  109. /**
  110. * Gets the perf counter used for animations time
  111. */
  112. get animationsTimeCounter(): PerfCounter;
  113. /**
  114. * Gets the animations time capture status
  115. */
  116. get captureAnimationsTime(): boolean;
  117. /**
  118. * Enable or disable the animations time capture
  119. */
  120. set captureAnimationsTime(value: boolean);
  121. /**
  122. * Gets the perf counter used for frame time capture
  123. */
  124. get frameTimeCounter(): PerfCounter;
  125. /**
  126. * Gets the frame time capture status
  127. */
  128. get captureFrameTime(): boolean;
  129. /**
  130. * Enable or disable the frame time capture
  131. */
  132. set captureFrameTime(value: boolean);
  133. /**
  134. * Gets the perf counter used for inter-frames time capture
  135. */
  136. get interFrameTimeCounter(): PerfCounter;
  137. /**
  138. * Gets the inter-frames time capture status
  139. */
  140. get captureInterFrameTime(): boolean;
  141. /**
  142. * Enable or disable the inter-frames time capture
  143. */
  144. set captureInterFrameTime(value: boolean);
  145. /**
  146. * Gets the perf counter used for render time capture
  147. */
  148. get renderTimeCounter(): PerfCounter;
  149. /**
  150. * Gets the render time capture status
  151. */
  152. get captureRenderTime(): boolean;
  153. /**
  154. * Enable or disable the render time capture
  155. */
  156. set captureRenderTime(value: boolean);
  157. /**
  158. * Gets the perf counter used for camera render time capture
  159. */
  160. get cameraRenderTimeCounter(): PerfCounter;
  161. /**
  162. * Gets the camera render time capture status
  163. */
  164. get captureCameraRenderTime(): boolean;
  165. /**
  166. * Enable or disable the camera render time capture
  167. */
  168. set captureCameraRenderTime(value: boolean);
  169. /**
  170. * Gets the perf counter used for draw calls
  171. */
  172. get drawCallsCounter(): PerfCounter;
  173. /**
  174. * Instantiates a new scene instrumentation.
  175. * This class can be used to get instrumentation data from a Babylon engine
  176. * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#sceneinstrumentation
  177. * @param scene Defines the scene to instrument
  178. */
  179. constructor(
  180. /**
  181. * Defines the scene to instrument
  182. */
  183. scene: Scene);
  184. /**
  185. * Dispose and release associated resources.
  186. */
  187. dispose(): void;
  188. }