index.d.ts 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. interface WebGLRenderingContext {
  2. readonly RASTERIZER_DISCARD: number;
  3. readonly TEXTURE_3D: number;
  4. readonly TEXTURE_2D_ARRAY: number;
  5. readonly TEXTURE_WRAP_R: number;
  6. texImage3D(target: number, level: number, internalformat: number, width: number, height: number, depth: number, border: number, format: number, type: number, pixels: ArrayBufferView | null): void;
  7. texImage3D(target: number, level: number, internalformat: number, width: number, height: number, depth: number, border: number, format: number, type: number, pixels: ArrayBufferView, offset: number): void;
  8. texImage3D(target: number, level: number, internalformat: number, width: number, height: number, depth: number, border: number, format: number, type: number, pixels: ImageBitmap | ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement): void;
  9. compressedTexImage3D(target: number, level: number, internalformat: number, width: number, height: number, depth: number, border: number, data: ArrayBufferView, offset?: number, length?: number): void;
  10. readonly TRANSFORM_FEEDBACK: number;
  11. readonly INTERLEAVED_ATTRIBS: number;
  12. readonly TRANSFORM_FEEDBACK_BUFFER: number;
  13. createTransformFeedback(): WebGLTransformFeedback;
  14. deleteTransformFeedback(transformFeedbac: WebGLTransformFeedback): void;
  15. bindTransformFeedback(target: number, transformFeedback: WebGLTransformFeedback | null): void;
  16. beginTransformFeedback(primitiveMode: number): void;
  17. endTransformFeedback(): void;
  18. transformFeedbackVaryings(program: WebGLProgram, varyings: string[], bufferMode: number): void;
  19. }
  20. export interface ImageBitmap {
  21. readonly width: number;
  22. readonly height: number;
  23. close(): void;
  24. }
  25. export interface WebGLQuery extends WebGLObject {
  26. }
  27. declare var WebGLQuery: {
  28. prototype: WebGLQuery;
  29. new (): WebGLQuery;
  30. };
  31. export interface WebGLSampler extends WebGLObject {
  32. }
  33. declare var WebGLSampler: {
  34. prototype: WebGLSampler;
  35. new (): WebGLSampler;
  36. };
  37. export interface WebGLSync extends WebGLObject {
  38. }
  39. declare var WebGLSync: {
  40. prototype: WebGLSync;
  41. new (): WebGLSync;
  42. };
  43. export interface WebGLTransformFeedback extends WebGLObject {
  44. }
  45. declare var WebGLTransformFeedback: {
  46. prototype: WebGLTransformFeedback;
  47. new (): WebGLTransformFeedback;
  48. };
  49. export interface WebGLVertexArrayObject extends WebGLObject {
  50. }
  51. declare var WebGLVertexArrayObject: {
  52. prototype: WebGLVertexArrayObject;
  53. new (): WebGLVertexArrayObject;
  54. };
  55. declare module 'babylonjs/instrumentation' {
  56. /**
  57. * This class can be used to get instrumentation data from a Babylon engine
  58. */
  59. class EngineInstrumentation implements IDisposable {
  60. engine: Engine;
  61. private _captureGPUFrameTime;
  62. private _gpuFrameTimeToken;
  63. private _gpuFrameTime;
  64. private _captureShaderCompilationTime;
  65. private _shaderCompilationTime;
  66. private _onBeginFrameObserver;
  67. private _onEndFrameObserver;
  68. private _onBeforeShaderCompilationObserver;
  69. private _onAfterShaderCompilationObserver;
  70. /**
  71. * Gets the perf counter used for GPU frame time
  72. */
  73. readonly gpuFrameTimeCounter: PerfCounter;
  74. /**
  75. * Gets the GPU frame time capture status
  76. */
  77. /**
  78. * Enable or disable the GPU frame time capture
  79. */
  80. captureGPUFrameTime: boolean;
  81. /**
  82. * Gets the perf counter used for shader compilation time
  83. */
  84. readonly shaderCompilationTimeCounter: PerfCounter;
  85. /**
  86. * Gets the shader compilation time capture status
  87. */
  88. /**
  89. * Enable or disable the shader compilation time capture
  90. */
  91. captureShaderCompilationTime: boolean;
  92. constructor(engine: Engine);
  93. dispose(): void;
  94. }
  95. }
  96. declare module 'babylonjs/instrumentation' {
  97. /**
  98. * This class can be used to get instrumentation data from a Babylon engine
  99. */
  100. class SceneInstrumentation implements IDisposable {
  101. scene: Scene;
  102. private _captureActiveMeshesEvaluationTime;
  103. private _activeMeshesEvaluationTime;
  104. private _captureRenderTargetsRenderTime;
  105. private _renderTargetsRenderTime;
  106. private _captureFrameTime;
  107. private _frameTime;
  108. private _captureRenderTime;
  109. private _renderTime;
  110. private _captureInterFrameTime;
  111. private _interFrameTime;
  112. private _captureParticlesRenderTime;
  113. private _particlesRenderTime;
  114. private _captureSpritesRenderTime;
  115. private _spritesRenderTime;
  116. private _capturePhysicsTime;
  117. private _physicsTime;
  118. private _captureAnimationsTime;
  119. private _animationsTime;
  120. private _onBeforeActiveMeshesEvaluationObserver;
  121. private _onAfterActiveMeshesEvaluationObserver;
  122. private _onBeforeRenderTargetsRenderObserver;
  123. private _onAfterRenderTargetsRenderObserver;
  124. private _onAfterRenderObserver;
  125. private _onBeforeDrawPhaseObserver;
  126. private _onAfterDrawPhaseObserver;
  127. private _onBeforeAnimationsObserver;
  128. private _onBeforeParticlesRenderingObserver;
  129. private _onAfterParticlesRenderingObserver;
  130. private _onBeforeSpritesRenderingObserver;
  131. private _onAfterSpritesRenderingObserver;
  132. private _onBeforePhysicsObserver;
  133. private _onAfterPhysicsObserver;
  134. private _onAfterAnimationsObserver;
  135. /**
  136. * Gets the perf counter used for active meshes evaluation time
  137. */
  138. readonly activeMeshesEvaluationTimeCounter: PerfCounter;
  139. /**
  140. * Gets the active meshes evaluation time capture status
  141. */
  142. /**
  143. * Enable or disable the active meshes evaluation time capture
  144. */
  145. captureActiveMeshesEvaluationTime: boolean;
  146. /**
  147. * Gets the perf counter used for render targets render time
  148. */
  149. readonly renderTargetsRenderTimeCounter: PerfCounter;
  150. /**
  151. * Gets the render targets render time capture status
  152. */
  153. /**
  154. * Enable or disable the render targets render time capture
  155. */
  156. captureRenderTargetsRenderTime: boolean;
  157. /**
  158. * Gets the perf counter used for particles render time
  159. */
  160. readonly particlesRenderTimeCounter: PerfCounter;
  161. /**
  162. * Gets the particles render time capture status
  163. */
  164. /**
  165. * Enable or disable the particles render time capture
  166. */
  167. captureParticlesRenderTime: boolean;
  168. /**
  169. * Gets the perf counter used for sprites render time
  170. */
  171. readonly spritesRenderTimeCounter: PerfCounter;
  172. /**
  173. * Gets the sprites render time capture status
  174. */
  175. /**
  176. * Enable or disable the sprites render time capture
  177. */
  178. captureSpritesRenderTime: boolean;
  179. /**
  180. * Gets the perf counter used for physics time
  181. */
  182. readonly physicsTimeCounter: PerfCounter;
  183. /**
  184. * Gets the physics time capture status
  185. */
  186. /**
  187. * Enable or disable the physics time capture
  188. */
  189. capturePhysicsTime: boolean;
  190. /**
  191. * Gets the perf counter used for animations time
  192. */
  193. readonly animationsTimeCounter: PerfCounter;
  194. /**
  195. * Gets the animations time capture status
  196. */
  197. /**
  198. * Enable or disable the animations time capture
  199. */
  200. captureAnimationsTime: boolean;
  201. /**
  202. * Gets the perf counter used for frame time capture
  203. */
  204. readonly frameTimeCounter: PerfCounter;
  205. /**
  206. * Gets the frame time capture status
  207. */
  208. /**
  209. * Enable or disable the frame time capture
  210. */
  211. captureFrameTime: boolean;
  212. /**
  213. * Gets the perf counter used for inter-frames time capture
  214. */
  215. readonly interFrameTimeCounter: PerfCounter;
  216. /**
  217. * Gets the inter-frames time capture status
  218. */
  219. /**
  220. * Enable or disable the inter-frames time capture
  221. */
  222. captureInterFrameTime: boolean;
  223. /**
  224. * Gets the perf counter used for render time capture
  225. */
  226. readonly renderTimeCounter: PerfCounter;
  227. /**
  228. * Gets the render time capture status
  229. */
  230. /**
  231. * Enable or disable the render time capture
  232. */
  233. captureRenderTime: boolean;
  234. /**
  235. * Gets the perf counter used for draw calls
  236. */
  237. readonly drawCallsCounter: PerfCounter;
  238. /**
  239. * Gets the perf counter used for texture collisions
  240. */
  241. readonly textureCollisionsCounter: PerfCounter;
  242. constructor(scene: Scene);
  243. dispose(): void;
  244. }
  245. }
  246. declare module 'babylonjs/instrumentation' {
  247. class _TimeToken {
  248. _startTimeQuery: Nullable<WebGLQuery>;
  249. _endTimeQuery: Nullable<WebGLQuery>;
  250. _timeElapsedQuery: Nullable<WebGLQuery>;
  251. _timeElapsedQueryEnded: boolean;
  252. }
  253. }
  254. import {EffectFallbacks,EffectCreationOptions,Effect,Nullable,float,double,int,FloatArray,IndicesArray,KeyboardEventTypes,KeyboardInfo,KeyboardInfoPre,PointerEventTypes,PointerInfoBase,PointerInfoPre,PointerInfo,ToGammaSpace,ToLinearSpace,Epsilon,Color3,Color4,Vector2,Vector3,Vector4,ISize,Size,Quaternion,Matrix,Plane,Viewport,Frustum,Space,Axis,BezierCurve,Orientation,Angle,Arc2,Path2,Path3D,Curve3,PositionNormalVertex,PositionNormalTextureVertex,Tmp,Scalar,expandToProperty,serialize,serializeAsTexture,serializeAsColor3,serializeAsFresnelParameters,serializeAsVector2,serializeAsVector3,serializeAsMeshReference,serializeAsColorCurves,serializeAsColor4,serializeAsImageProcessingConfiguration,serializeAsQuaternion,SerializationHelper,EventState,Observer,MultiObserver,Observable,SmartArray,SmartArrayNoDuplicate,IAnimatable,LoadFileError,RetryStrategy,IFileRequest,Tools,PerfCounter,className,AsyncLoop,_AlphaState,_DepthCullingState,_StencilState,InstancingAttributeInfo,RenderTargetCreationOptions,EngineCapabilities,EngineOptions,IDisplayChangedEventArgs,Engine,Node,BoundingSphere,BoundingBox,ICullable,BoundingInfo,TransformNode,AbstractMesh,Light,Camera,RenderingManager,RenderingGroup,IDisposable,IActiveMeshCandidateProvider,RenderingGroupInfo,Scene,Buffer,VertexBuffer,InternalTexture,BaseTexture,Texture,_InstancesBatch,Mesh,BaseSubMesh,SubMesh,MaterialDefines,Material,UniformBuffer,IGetSetVerticesData,VertexData,Geometry,_PrimitiveGeometry,RibbonGeometry,BoxGeometry,SphereGeometry,DiscGeometry,CylinderGeometry,TorusGeometry,GroundGeometry,TiledGroundGeometry,PlaneGeometry,TorusKnotGeometry,PostProcessManager,PerformanceMonitor,RollingAverage,IImageProcessingConfigurationDefines,ImageProcessingConfiguration,ColorGradingTexture,ColorCurves,Behavior,MaterialHelper,PushMaterial,StandardMaterialDefines,StandardMaterial} from 'babylonjs/core';
  255. import {Particle,IParticleSystem,ParticleSystem,BoxParticleEmitter,ConeParticleEmitter,SphereParticleEmitter,SphereDirectedParticleEmitter,IParticleEmitterType} from 'babylonjs/particles';
  256. import {GPUParticleSystem} from 'babylonjs/gpuParticles';
  257. import {FramingBehavior,BouncingBehavior,AutoRotationBehavior} from 'babylonjs/cameraBehaviors';
  258. import {NullEngineOptions,NullEngine} from 'babylonjs/nullEngine';
  259. import {TextureTools} from 'babylonjs/textureTools';
  260. import {SolidParticle,ModelShape,DepthSortedParticle,SolidParticleSystem} from 'babylonjs/solidParticles';
  261. import {Collider,CollisionWorker,ICollisionCoordinator,SerializedMesh,SerializedSubMesh,SerializedGeometry,BabylonMessage,SerializedColliderToWorker,WorkerTaskType,WorkerReply,CollisionReplyPayload,InitPayload,CollidePayload,UpdatePayload,WorkerReplyType,CollisionCoordinatorWorker,CollisionCoordinatorLegacy} from 'babylonjs/collisions';
  262. import {IntersectionInfo,PickingInfo,Ray} from 'babylonjs/picking';
  263. import {SpriteManager,Sprite} from 'babylonjs/sprites';
  264. import {AnimationRange,AnimationEvent,PathCursor,Animation,TargetedAnimation,AnimationGroup,RuntimeAnimation,Animatable,IEasingFunction,EasingFunction,CircleEase,BackEase,BounceEase,CubicEase,ElasticEase,ExponentialEase,PowerEase,QuadraticEase,QuarticEase,QuinticEase,SineEase,BezierCurveEase} from 'babylonjs/animations';
  265. import {Condition,ValueCondition,PredicateCondition,StateCondition,Action,ActionEvent,ActionManager,InterpolateValueAction,SwitchBooleanAction,SetStateAction,SetValueAction,IncrementValueAction,PlayAnimationAction,StopAnimationAction,DoNothingAction,CombineAction,ExecuteCodeAction,SetParentAction,PlaySoundAction,StopSoundAction} from 'babylonjs/actions';
  266. import {GroundMesh,InstancedMesh,LinesMesh} from 'babylonjs/additionalMeshes';
  267. import {ShaderMaterial} from 'babylonjs/shaderMaterial';
  268. import {MeshBuilder} from 'babylonjs/meshBuilder';
  269. import {PBRBaseMaterial,PBRBaseSimpleMaterial,PBRMaterial,PBRMetallicRoughnessMaterial,PBRSpecularGlossinessMaterial} from 'babylonjs/pbrMaterial';
  270. import {CameraInputTypes,ICameraInput,CameraInputsMap,CameraInputsManager,TargetCamera} from 'babylonjs/targetCamera';
  271. import {ArcRotateCameraKeyboardMoveInput,ArcRotateCameraMouseWheelInput,ArcRotateCameraPointersInput,ArcRotateCameraInputsManager,ArcRotateCamera} from 'babylonjs/arcRotateCamera';
  272. import {FreeCameraMouseInput,FreeCameraKeyboardMoveInput,FreeCameraInputsManager,FreeCamera} from 'babylonjs/freeCamera';
  273. import {HemisphericLight} from 'babylonjs/hemisphericLight';
  274. import {IShadowLight,ShadowLight,PointLight} from 'babylonjs/pointLight';
  275. import {DirectionalLight} from 'babylonjs/directionalLight';
  276. import {SpotLight} from 'babylonjs/spotLight';
  277. import {CubeTexture,RenderTargetTexture,IMultiRenderTargetOptions,MultiRenderTarget,MirrorTexture,RefractionTexture,DynamicTexture,VideoTexture,RawTexture} from 'babylonjs/additionalTextures';
  278. import {AudioEngine,Sound,SoundTrack,Analyser} from 'babylonjs/audio';
  279. import {ILoadingScreen,DefaultLoadingScreen,SceneLoaderProgressEvent,ISceneLoaderPluginExtensions,ISceneLoaderPluginFactory,ISceneLoaderPlugin,ISceneLoaderPluginAsync,SceneLoader,FilesInput} from 'babylonjs/loader';
  280. import {IShadowGenerator,ShadowGenerator} from 'babylonjs/shadows';
  281. import {StringDictionary} from 'babylonjs/stringDictionary';
  282. import {Tags,AndOrNotEvaluator} from 'babylonjs/userData';
  283. import {FresnelParameters} from 'babylonjs/fresnel';
  284. import {MultiMaterial} from 'babylonjs/multiMaterial';
  285. import {Database} from 'babylonjs/offline';
  286. import {FreeCameraTouchInput,TouchCamera} from 'babylonjs/touchCamera';
  287. import {ProceduralTexture,CustomProceduralTexture} from 'babylonjs/procedural';
  288. import {FreeCameraGamepadInput,ArcRotateCameraGamepadInput,GamepadManager,StickValues,GamepadButtonChanges,Gamepad,GenericPad,Xbox360Button,Xbox360Dpad,Xbox360Pad,PoseEnabledControllerType,MutableGamepadButton,ExtendedGamepadButton,PoseEnabledControllerHelper,PoseEnabledController,WebVRController,OculusTouchController,ViveController,GenericController,WindowsMotionController} from 'babylonjs/gamepad';
  289. import {FollowCamera,ArcFollowCamera,UniversalCamera,GamepadCamera} from 'babylonjs/additionalCameras';
  290. import {DepthRenderer} from 'babylonjs/depthRenderer';
  291. import {GeometryBufferRenderer} from 'babylonjs/geometryBufferRenderer';
  292. import {PostProcessOptions,PostProcess,PassPostProcess} from 'babylonjs/postProcesses';
  293. import {BlurPostProcess} from 'babylonjs/additionalPostProcess_blur';
  294. import {FxaaPostProcess} from 'babylonjs/additionalPostProcess_fxaa';
  295. import {HighlightsPostProcess} from 'babylonjs/additionalPostProcess_highlights';
  296. import {RefractionPostProcess,BlackAndWhitePostProcess,ConvolutionPostProcess,FilterPostProcess,VolumetricLightScatteringPostProcess,ColorCorrectionPostProcess,TonemappingOperator,TonemapPostProcess,DisplayPassPostProcess,ImageProcessingPostProcess} from 'babylonjs/additionalPostProcesses';
  297. import {PostProcessRenderPipelineManager,PostProcessRenderPass,PostProcessRenderEffect,PostProcessRenderPipeline} from 'babylonjs/renderingPipeline';
  298. import {SSAORenderingPipeline,SSAO2RenderingPipeline,LensRenderingPipeline,StandardRenderingPipeline} from 'babylonjs/additionalRenderingPipeline';
  299. import {DefaultRenderingPipeline} from 'babylonjs/defaultRenderingPipeline';
  300. import {Bone,BoneIKController,BoneLookController,Skeleton} from 'babylonjs/bones';
  301. import {SphericalPolynomial,SphericalHarmonics,CubeMapToSphericalPolynomialTools,CubeMapInfo,PanoramaToCubeMapTools,HDRInfo,HDRTools,HDRCubeTexture} from 'babylonjs/hdr';
  302. import {CSG} from 'babylonjs/csg';
  303. import {Polygon,PolygonMeshBuilder} from 'babylonjs/polygonMesh';
  304. import {LensFlare,LensFlareSystem} from 'babylonjs/lensFlares';
  305. import {PhysicsJointData,PhysicsJoint,DistanceJoint,MotorEnabledJoint,HingeJoint,Hinge2Joint,IMotorEnabledJoint,DistanceJointData,SpringJointData,PhysicsImpostorParameters,IPhysicsEnabledObject,PhysicsImpostor,PhysicsImpostorJoint,PhysicsEngine,IPhysicsEnginePlugin,PhysicsHelper,PhysicsRadialExplosionEvent,PhysicsGravitationalFieldEvent,PhysicsUpdraftEvent,PhysicsVortexEvent,PhysicsRadialImpulseFalloff,PhysicsUpdraftMode,PhysicsForceAndContactPoint,PhysicsRadialExplosionEventData,PhysicsGravitationalFieldEventData,PhysicsUpdraftEventData,PhysicsVortexEventData,CannonJSPlugin,OimoJSPlugin} from 'babylonjs/physics';
  306. import {TGATools,DDSInfo,DDSTools,KhronosTextureContainer} from 'babylonjs/textureFormats';
  307. import {Debug,RayHelper,DebugLayer,BoundingBoxRenderer} from 'babylonjs/debug';
  308. import {MorphTarget,MorphTargetManager} from 'babylonjs/morphTargets';
  309. import {IOctreeContainer,Octree,OctreeBlock} from 'babylonjs/octrees';
  310. import {SIMDHelper} from 'babylonjs/simd';
  311. import {VRDistortionCorrectionPostProcess,AnaglyphPostProcess,StereoscopicInterlacePostProcess,FreeCameraDeviceOrientationInput,ArcRotateCameraVRDeviceOrientationInput,VRCameraMetrics,DevicePose,PoseControlled,WebVROptions,WebVRFreeCamera,DeviceOrientationCamera,VRDeviceOrientationFreeCamera,VRDeviceOrientationGamepadCamera,VRDeviceOrientationArcRotateCamera,AnaglyphFreeCamera,AnaglyphArcRotateCamera,AnaglyphGamepadCamera,AnaglyphUniversalCamera,StereoscopicFreeCamera,StereoscopicArcRotateCamera,StereoscopicGamepadCamera,StereoscopicUniversalCamera,VRTeleportationOptions,VRExperienceHelperOptions,VRExperienceHelper} from 'babylonjs/vr';
  312. import {JoystickAxis,VirtualJoystick,VirtualJoysticksCamera,FreeCameraVirtualJoystickInput} from 'babylonjs/virtualJoystick';
  313. import {ISimplifier,ISimplificationSettings,SimplificationSettings,ISimplificationTask,SimplificationQueue,SimplificationType,DecimationTriangle,DecimationVertex,QuadraticMatrix,Reference,QuadraticErrorSimplification,MeshLODLevel,SceneOptimization,TextureOptimization,HardwareScalingOptimization,ShadowsOptimization,PostProcessesOptimization,LensFlaresOptimization,ParticlesOptimization,RenderTargetsOptimization,MergeMeshesOptimization,SceneOptimizerOptions,SceneOptimizer} from 'babylonjs/optimizations';
  314. import {OutlineRenderer,EdgesRenderer,IHighlightLayerOptions,HighlightLayer} from 'babylonjs/highlights';
  315. import {SceneSerializer} from 'babylonjs/serialization';
  316. import {AssetTaskState,AbstractAssetTask,IAssetsProgressEvent,AssetsProgressEvent,MeshAssetTask,TextFileAssetTask,BinaryFileAssetTask,ImageAssetTask,ITextureAssetTask,TextureAssetTask,CubeTextureAssetTask,HDRCubeTextureAssetTask,AssetsManager} from 'babylonjs/assetsManager';
  317. import {ReflectionProbe} from 'babylonjs/probes';
  318. import {BackgroundMaterial} from 'babylonjs/backgroundMaterial';
  319. import {Layer} from 'babylonjs/layer';
  320. import {IEnvironmentHelperOptions,EnvironmentHelper} from 'babylonjs/environmentHelper';