@babylonjs/core 5.35.0 → 5.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. package/Audio/sound.d.ts +5 -0
  2. package/Audio/sound.js +7 -0
  3. package/Audio/sound.js.map +1 -1
  4. package/Debug/physicsViewer.d.ts +4 -3
  5. package/Debug/physicsViewer.js +2 -2
  6. package/Debug/physicsViewer.js.map +1 -1
  7. package/Engines/Extensions/engine.renderTarget.js +15 -15
  8. package/Engines/Extensions/engine.renderTarget.js.map +1 -1
  9. package/Engines/Extensions/engine.renderTargetCube.d.ts +1 -1
  10. package/Engines/Extensions/engine.renderTargetCube.js.map +1 -1
  11. package/Engines/Extensions/engine.views.d.ts +4 -0
  12. package/Engines/Extensions/engine.views.js +61 -42
  13. package/Engines/Extensions/engine.views.js.map +1 -1
  14. package/Engines/Native/nativeHardwareTexture.d.ts +14 -0
  15. package/Engines/Native/nativeHardwareTexture.js +24 -0
  16. package/Engines/Native/nativeHardwareTexture.js.map +1 -0
  17. package/Engines/Native/nativeInterfaces.d.ts +22 -15
  18. package/Engines/Native/nativeInterfaces.js.map +1 -1
  19. package/Engines/Native/nativePipelineContext.d.ts +252 -0
  20. package/Engines/Native/nativePipelineContext.js +502 -0
  21. package/Engines/Native/nativePipelineContext.js.map +1 -0
  22. package/Engines/Native/nativeRenderTargetWrapper.d.ts +16 -0
  23. package/Engines/Native/nativeRenderTargetWrapper.js +33 -0
  24. package/Engines/Native/nativeRenderTargetWrapper.js.map +1 -0
  25. package/Engines/WebGPU/Extensions/engine.renderTarget.js +3 -3
  26. package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
  27. package/Engines/WebGPU/Extensions/engine.renderTargetCube.js.map +1 -1
  28. package/Engines/engine.d.ts +1 -0
  29. package/Engines/engine.js +24 -18
  30. package/Engines/engine.js.map +1 -1
  31. package/Engines/nativeEngine.d.ts +18 -17
  32. package/Engines/nativeEngine.js +100 -598
  33. package/Engines/nativeEngine.js.map +1 -1
  34. package/Engines/nullEngine.d.ts +1 -1
  35. package/Engines/nullEngine.js.map +1 -1
  36. package/Engines/thinEngine.d.ts +1 -1
  37. package/Engines/thinEngine.js +41 -38
  38. package/Engines/thinEngine.js.map +1 -1
  39. package/Engines/webgpuEngine.js.map +1 -1
  40. package/Gizmos/planeRotationGizmo.js +3 -1
  41. package/Gizmos/planeRotationGizmo.js.map +1 -1
  42. package/Inputs/scene.inputManager.js +4 -4
  43. package/Inputs/scene.inputManager.js.map +1 -1
  44. package/Loading/Plugins/babylonFileLoader.js +3 -3
  45. package/Loading/Plugins/babylonFileLoader.js.map +1 -1
  46. package/Materials/Node/Blocks/Dual/textureBlock.js +1 -1
  47. package/Materials/Node/Blocks/Dual/textureBlock.js.map +1 -1
  48. package/Materials/Node/nodeMaterial.d.ts +19 -1
  49. package/Materials/Node/nodeMaterial.js +30 -0
  50. package/Materials/Node/nodeMaterial.js.map +1 -1
  51. package/Materials/Node/nodeMaterialBuildStateSharedData.d.ts +2 -8
  52. package/Materials/Node/nodeMaterialBuildStateSharedData.js.map +1 -1
  53. package/Materials/Textures/baseTexture.d.ts +2 -1
  54. package/Materials/Textures/baseTexture.js +3 -2
  55. package/Materials/Textures/baseTexture.js.map +1 -1
  56. package/Materials/Textures/internalTexture.d.ts +2 -0
  57. package/Materials/Textures/internalTexture.js +4 -0
  58. package/Materials/Textures/internalTexture.js.map +1 -1
  59. package/Materials/Textures/mirrorTexture.js +0 -2
  60. package/Materials/Textures/mirrorTexture.js.map +1 -1
  61. package/Materials/Textures/renderTargetTexture.d.ts +53 -3
  62. package/Materials/Textures/renderTargetTexture.js +25 -25
  63. package/Materials/Textures/renderTargetTexture.js.map +1 -1
  64. package/Materials/Textures/texture.d.ts +2 -0
  65. package/Materials/Textures/texture.js +35 -7
  66. package/Materials/Textures/texture.js.map +1 -1
  67. package/Materials/Textures/textureCreationOptions.d.ts +4 -1
  68. package/Materials/Textures/textureCreationOptions.js.map +1 -1
  69. package/Materials/material.js +1 -1
  70. package/Materials/material.js.map +1 -1
  71. package/Meshes/abstractMesh.d.ts +4 -4
  72. package/Meshes/abstractMesh.js +4 -4
  73. package/Meshes/abstractMesh.js.map +1 -1
  74. package/Meshes/mesh.d.ts +2 -2
  75. package/Meshes/mesh.js +1 -1
  76. package/Meshes/mesh.js.map +1 -1
  77. package/Misc/copyTextureToTexture.d.ts +9 -2
  78. package/Misc/copyTextureToTexture.js +23 -1
  79. package/Misc/copyTextureToTexture.js.map +1 -1
  80. package/Particles/IParticleSystem.d.ts +15 -1
  81. package/Particles/IParticleSystem.js.map +1 -1
  82. package/Particles/gpuParticleSystem.d.ts +24 -2
  83. package/Particles/gpuParticleSystem.js +98 -43
  84. package/Particles/gpuParticleSystem.js.map +1 -1
  85. package/Particles/particleSystem.d.ts +6 -1
  86. package/Particles/particleSystem.js +7 -2
  87. package/Particles/particleSystem.js.map +1 -1
  88. package/Physics/IPhysicsEngine.d.ts +8 -108
  89. package/Physics/IPhysicsEngine.js.map +1 -1
  90. package/Physics/Plugins/ammoJSPlugin.d.ts +1 -389
  91. package/Physics/Plugins/ammoJSPlugin.js +2 -1414
  92. package/Physics/Plugins/ammoJSPlugin.js.map +1 -1
  93. package/Physics/Plugins/cannonJSPlugin.d.ts +1 -75
  94. package/Physics/Plugins/cannonJSPlugin.js +2 -664
  95. package/Physics/Plugins/cannonJSPlugin.js.map +1 -1
  96. package/Physics/Plugins/oimoJSPlugin.d.ts +1 -59
  97. package/Physics/Plugins/oimoJSPlugin.js +2 -432
  98. package/Physics/Plugins/oimoJSPlugin.js.map +1 -1
  99. package/Physics/index.d.ts +3 -6
  100. package/Physics/index.js +3 -6
  101. package/Physics/index.js.map +1 -1
  102. package/Physics/physicsEngine.d.ts +1 -135
  103. package/Physics/physicsEngine.js +2 -221
  104. package/Physics/physicsEngine.js.map +1 -1
  105. package/Physics/physicsEngineComponent.d.ts +7 -42
  106. package/Physics/physicsEngineComponent.js +11 -71
  107. package/Physics/physicsEngineComponent.js.map +1 -1
  108. package/Physics/physicsHelper.d.ts +1 -411
  109. package/Physics/physicsHelper.js +2 -708
  110. package/Physics/physicsHelper.js.map +1 -1
  111. package/Physics/physicsImpostor.d.ts +1 -640
  112. package/Physics/physicsImpostor.js +2 -1004
  113. package/Physics/physicsImpostor.js.map +1 -1
  114. package/Physics/physicsJoint.d.ts +1 -275
  115. package/Physics/physicsJoint.js +2 -222
  116. package/Physics/physicsJoint.js.map +1 -1
  117. package/Physics/v1/IPhysicsEnginePlugin.d.ts +73 -0
  118. package/Physics/v1/IPhysicsEnginePlugin.js +2 -0
  119. package/Physics/v1/IPhysicsEnginePlugin.js.map +1 -0
  120. package/Physics/v1/Plugins/ammoJSPlugin.d.ts +401 -0
  121. package/Physics/v1/Plugins/ammoJSPlugin.js +1431 -0
  122. package/Physics/v1/Plugins/ammoJSPlugin.js.map +1 -0
  123. package/Physics/v1/Plugins/cannonJSPlugin.d.ts +87 -0
  124. package/Physics/v1/Plugins/cannonJSPlugin.js +683 -0
  125. package/Physics/v1/Plugins/cannonJSPlugin.js.map +1 -0
  126. package/Physics/{Plugins → v1/Plugins}/index.d.ts +0 -0
  127. package/Physics/{Plugins → v1/Plugins}/index.js +0 -0
  128. package/Physics/v1/Plugins/index.js.map +1 -0
  129. package/Physics/v1/Plugins/oimoJSPlugin.d.ts +71 -0
  130. package/Physics/v1/Plugins/oimoJSPlugin.js +450 -0
  131. package/Physics/v1/Plugins/oimoJSPlugin.js.map +1 -0
  132. package/Physics/v1/index.d.ts +7 -0
  133. package/Physics/v1/index.js +9 -0
  134. package/Physics/v1/index.js.map +1 -0
  135. package/Physics/v1/physicsEngine.d.ts +147 -0
  136. package/Physics/v1/physicsEngine.js +237 -0
  137. package/Physics/v1/physicsEngine.js.map +1 -0
  138. package/Physics/v1/physicsEngineComponent.d.ts +45 -0
  139. package/Physics/v1/physicsEngineComponent.js +70 -0
  140. package/Physics/v1/physicsEngineComponent.js.map +1 -0
  141. package/Physics/v1/physicsHelper.d.ts +411 -0
  142. package/Physics/v1/physicsHelper.js +709 -0
  143. package/Physics/v1/physicsHelper.js.map +1 -0
  144. package/Physics/v1/physicsImpostor.d.ts +636 -0
  145. package/Physics/v1/physicsImpostor.js +1001 -0
  146. package/Physics/v1/physicsImpostor.js.map +1 -0
  147. package/Physics/v1/physicsJoint.d.ts +275 -0
  148. package/Physics/v1/physicsJoint.js +223 -0
  149. package/Physics/v1/physicsJoint.js.map +1 -0
  150. package/Physics/v2/IPhysicsEnginePlugin.d.ts +170 -0
  151. package/Physics/v2/IPhysicsEnginePlugin.js +47 -0
  152. package/Physics/v2/IPhysicsEnginePlugin.js.map +1 -0
  153. package/Physics/v2/Plugins/index.d.ts +0 -0
  154. package/Physics/v2/Plugins/index.js +2 -0
  155. package/Physics/v2/Plugins/index.js.map +1 -0
  156. package/Physics/v2/index.d.ts +6 -0
  157. package/Physics/v2/index.js +8 -0
  158. package/Physics/v2/index.js.map +1 -0
  159. package/Physics/v2/physicsAggregate.d.ts +114 -0
  160. package/Physics/v2/physicsAggregate.js +46 -0
  161. package/Physics/v2/physicsAggregate.js.map +1 -0
  162. package/Physics/v2/physicsBody.d.ts +109 -0
  163. package/Physics/v2/physicsBody.js +158 -0
  164. package/Physics/v2/physicsBody.js.map +1 -0
  165. package/Physics/v2/physicsConstraint.d.ts +184 -0
  166. package/Physics/v2/physicsConstraint.js +257 -0
  167. package/Physics/v2/physicsConstraint.js.map +1 -0
  168. package/Physics/v2/physicsEngine.d.ts +103 -0
  169. package/Physics/v2/physicsEngine.js +146 -0
  170. package/Physics/v2/physicsEngine.js.map +1 -0
  171. package/Physics/v2/physicsEngineComponent.d.ts +31 -0
  172. package/Physics/v2/physicsEngineComponent.js +50 -0
  173. package/Physics/v2/physicsEngineComponent.js.map +1 -0
  174. package/Physics/v2/physicsMaterial.d.ts +45 -0
  175. package/Physics/v2/physicsMaterial.js +67 -0
  176. package/Physics/v2/physicsMaterial.js.map +1 -0
  177. package/Physics/v2/physicsShape.d.ts +182 -0
  178. package/Physics/v2/physicsShape.js +229 -0
  179. package/Physics/v2/physicsShape.js.map +1 -0
  180. package/PostProcesses/postProcess.d.ts +3 -1
  181. package/PostProcesses/postProcess.js +4 -1
  182. package/PostProcesses/postProcess.js.map +1 -1
  183. package/Rendering/fluidRenderer/fluidRenderer.d.ts +153 -0
  184. package/Rendering/fluidRenderer/fluidRenderer.js +410 -0
  185. package/Rendering/fluidRenderer/fluidRenderer.js.map +1 -0
  186. package/Rendering/fluidRenderer/fluidRenderingDepthTextureCopy.d.ts +13 -0
  187. package/Rendering/fluidRenderer/fluidRenderingDepthTextureCopy.js +31 -0
  188. package/Rendering/fluidRenderer/fluidRenderingDepthTextureCopy.js.map +1 -0
  189. package/Rendering/fluidRenderer/fluidRenderingObject.d.ts +81 -0
  190. package/Rendering/fluidRenderer/fluidRenderingObject.js +180 -0
  191. package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -0
  192. package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.d.ts +63 -0
  193. package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js +130 -0
  194. package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js.map +1 -0
  195. package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.d.ts +64 -0
  196. package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js +104 -0
  197. package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js.map +1 -0
  198. package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.d.ts +234 -0
  199. package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js +690 -0
  200. package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js.map +1 -0
  201. package/Rendering/fluidRenderer/fluidRenderingTextures.d.ts +56 -0
  202. package/Rendering/fluidRenderer/fluidRenderingTextures.js +261 -0
  203. package/Rendering/fluidRenderer/fluidRenderingTextures.js.map +1 -0
  204. package/Rendering/fluidRenderer/index.d.ts +5 -0
  205. package/Rendering/fluidRenderer/index.js +6 -0
  206. package/Rendering/fluidRenderer/index.js.map +1 -0
  207. package/Rendering/index.d.ts +1 -0
  208. package/Rendering/index.js +2 -0
  209. package/Rendering/index.js.map +1 -1
  210. package/Shaders/copyTextureToTexture.fragment.js +4 -1
  211. package/Shaders/copyTextureToTexture.fragment.js.map +1 -1
  212. package/Shaders/fluidRenderingBilateralBlur.fragment.d.ts +5 -0
  213. package/Shaders/fluidRenderingBilateralBlur.fragment.js +9 -0
  214. package/Shaders/fluidRenderingBilateralBlur.fragment.js.map +1 -0
  215. package/Shaders/fluidRenderingParticleDepth.fragment.d.ts +5 -0
  216. package/Shaders/fluidRenderingParticleDepth.fragment.js +17 -0
  217. package/Shaders/fluidRenderingParticleDepth.fragment.js.map +1 -0
  218. package/Shaders/fluidRenderingParticleDepth.vertex.d.ts +5 -0
  219. package/Shaders/fluidRenderingParticleDepth.vertex.js +13 -0
  220. package/Shaders/fluidRenderingParticleDepth.vertex.js.map +1 -0
  221. package/Shaders/fluidRenderingParticleDiffuse.fragment.d.ts +5 -0
  222. package/Shaders/fluidRenderingParticleDiffuse.fragment.js +9 -0
  223. package/Shaders/fluidRenderingParticleDiffuse.fragment.js.map +1 -0
  224. package/Shaders/fluidRenderingParticleDiffuse.vertex.d.ts +5 -0
  225. package/Shaders/fluidRenderingParticleDiffuse.vertex.js +4 -0
  226. package/Shaders/fluidRenderingParticleDiffuse.vertex.js.map +1 -0
  227. package/Shaders/fluidRenderingParticleThickness.fragment.d.ts +5 -0
  228. package/Shaders/fluidRenderingParticleThickness.fragment.js +9 -0
  229. package/Shaders/fluidRenderingParticleThickness.fragment.js.map +1 -0
  230. package/Shaders/fluidRenderingParticleThickness.vertex.d.ts +5 -0
  231. package/Shaders/fluidRenderingParticleThickness.vertex.js +9 -0
  232. package/Shaders/fluidRenderingParticleThickness.vertex.js.map +1 -0
  233. package/Shaders/fluidRenderingRender.fragment.d.ts +5 -0
  234. package/Shaders/fluidRenderingRender.fragment.js +46 -0
  235. package/Shaders/fluidRenderingRender.fragment.js.map +1 -0
  236. package/Shaders/fluidRenderingStandardBlur.fragment.d.ts +5 -0
  237. package/Shaders/fluidRenderingStandardBlur.fragment.js +9 -0
  238. package/Shaders/fluidRenderingStandardBlur.fragment.js.map +1 -0
  239. package/XR/features/WebXRControllerPhysics.d.ts +1 -1
  240. package/XR/features/WebXRControllerPhysics.js +1 -1
  241. package/XR/features/WebXRControllerPhysics.js.map +1 -1
  242. package/XR/features/WebXRHandTracking.js +1 -1
  243. package/XR/features/WebXRHandTracking.js.map +1 -1
  244. package/package.json +1 -1
  245. package/scene.js +6 -1
  246. package/scene.js.map +1 -1
  247. package/sceneComponent.d.ts +3 -0
  248. package/sceneComponent.js +3 -0
  249. package/sceneComponent.js.map +1 -1
  250. package/Physics/Plugins/index.js.map +0 -1
@@ -4,6 +4,11 @@ import type { InternalTexture } from "../../Materials/Textures/internalTexture";
4
4
  import type { Nullable } from "../../types";
5
5
  import type { ICanvas, IImage } from "../ICanvas";
6
6
  import type { NativeData, NativeDataStream } from "./nativeDataStream";
7
+ export declare type NativeTexture = NativeData;
8
+ export declare type NativeFramebuffer = NativeData;
9
+ export declare type NativeVertexArrayObject = NativeData;
10
+ export declare type NativeProgram = NativeData;
11
+ export declare type NativeUniform = NativeData;
7
12
  /** @internal */
8
13
  export interface INativeEngine {
9
14
  dispose(): void;
@@ -15,23 +20,24 @@ export interface INativeEngine {
15
20
  createVertexBuffer(bytes: ArrayBuffer, byteOffset: number, byteLength: number, dynamic: boolean): NativeData;
16
21
  recordVertexBuffer(vertexArray: NativeData, vertexBuffer: NativeData, location: number, byteOffset: number, byteStride: number, numElements: number, type: number, normalized: boolean, instanceDivisor: number): void;
17
22
  updateDynamicVertexBuffer(vertexBuffer: NativeData, bytes: ArrayBuffer, byteOffset: number, byteLength: number): void;
18
- createProgram(vertexShader: string, fragmentShader: string): any;
19
- getUniforms(shaderProgram: any, uniformsNames: string[]): WebGLUniformLocation[];
20
- getAttributes(shaderProgram: any, attributeNames: string[]): number[];
21
- createTexture(): WebGLTexture;
22
- loadTexture(texture: WebGLTexture, data: ArrayBufferView, generateMips: boolean, invertY: boolean, srgb: boolean, onSuccess: () => void, onError: () => void): void;
23
- loadRawTexture(texture: WebGLTexture, data: ArrayBufferView, width: number, height: number, format: number, generateMips: boolean, invertY: boolean): void;
24
- loadRawTexture2DArray(texture: WebGLTexture, data: Nullable<ArrayBufferView>, width: number, height: number, depth: number, format: number, generateMipMaps: boolean, invertY: boolean): void;
25
- loadCubeTexture(texture: WebGLTexture, data: Array<ArrayBufferView>, generateMips: boolean, invertY: boolean, srgb: boolean, onSuccess: () => void, onError: () => void): void;
26
- loadCubeTextureWithMips(texture: WebGLTexture, data: Array<Array<ArrayBufferView>>, invertY: boolean, srgb: boolean, onSuccess: () => void, onError: () => void): void;
27
- getTextureWidth(texture: WebGLTexture): number;
28
- getTextureHeight(texture: WebGLTexture): number;
29
- copyTexture(desination: Nullable<WebGLTexture>, source: Nullable<WebGLTexture>): void;
30
- deleteTexture(texture: Nullable<WebGLTexture>): void;
31
- readTexture(texture: WebGLTexture, mipLevel: number, x: number, y: number, width: number, height: number, buffer: Nullable<ArrayBuffer>, bufferOffset: number, bufferLength: number): Promise<ArrayBuffer>;
23
+ createProgram(vertexShader: string, fragmentShader: string): NativeProgram;
24
+ getUniforms(shaderProgram: NativeProgram, uniformsNames: string[]): WebGLUniformLocation[];
25
+ getAttributes(shaderProgram: NativeProgram, attributeNames: string[]): number[];
26
+ createTexture(): NativeTexture;
27
+ initializeTexture(texture: NativeTexture, width: number, height: number, hasMips: boolean, format: number, renderTarget: boolean, srgb: boolean): void;
28
+ loadTexture(texture: NativeTexture, data: ArrayBufferView, generateMips: boolean, invertY: boolean, srgb: boolean, onSuccess: () => void, onError: () => void): void;
29
+ loadRawTexture(texture: NativeTexture, data: ArrayBufferView, width: number, height: number, format: number, generateMips: boolean, invertY: boolean): void;
30
+ loadRawTexture2DArray(texture: NativeTexture, data: Nullable<ArrayBufferView>, width: number, height: number, depth: number, format: number, generateMipMaps: boolean, invertY: boolean): void;
31
+ loadCubeTexture(texture: NativeTexture, data: Array<ArrayBufferView>, generateMips: boolean, invertY: boolean, srgb: boolean, onSuccess: () => void, onError: () => void): void;
32
+ loadCubeTextureWithMips(texture: NativeTexture, data: Array<Array<ArrayBufferView>>, invertY: boolean, srgb: boolean, onSuccess: () => void, onError: () => void): void;
33
+ getTextureWidth(texture: NativeTexture): number;
34
+ getTextureHeight(texture: NativeTexture): number;
35
+ copyTexture(desination: NativeTexture, source: NativeTexture): void;
36
+ deleteTexture(texture: NativeTexture): void;
37
+ readTexture(texture: NativeTexture, mipLevel: number, x: number, y: number, width: number, height: number, buffer: Nullable<ArrayBuffer>, bufferOffset: number, bufferLength: number): Promise<ArrayBuffer>;
32
38
  createImageBitmap(data: ArrayBufferView | IImage): ImageBitmap;
33
39
  resizeImageBitmap(image: ImageBitmap, bufferWidth: number, bufferHeight: number): Uint8Array;
34
- createFrameBuffer(texture: WebGLTexture, width: number, height: number, format: number, generateStencilBuffer: boolean, generateDepthBuffer: boolean, generateMips: boolean): WebGLFramebuffer;
40
+ createFrameBuffer(texture: Nullable<NativeTexture>, width: number, height: number, generateStencilBuffer: boolean, generateDepthBuffer: boolean): NativeFramebuffer;
35
41
  getRenderWidth(): number;
36
42
  getRenderHeight(): number;
37
43
  getHardwareScalingLevel(): number;
@@ -74,6 +80,7 @@ interface INativeEngineConstructor {
74
80
  readonly ADDRESS_MODE_MIRROR_ONCE: number;
75
81
  readonly TEXTURE_FORMAT_RGB8: number;
76
82
  readonly TEXTURE_FORMAT_RGBA8: number;
83
+ readonly TEXTURE_FORMAT_RGBA16F: number;
77
84
  readonly TEXTURE_FORMAT_RGBA32F: number;
78
85
  readonly ATTRIB_TYPE_INT8: number;
79
86
  readonly ATTRIB_TYPE_UINT8: number;
@@ -1 +1 @@
1
- {"version":3,"file":"nativeInterfaces.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Engines/Native/nativeInterfaces.ts"],"names":[],"mappings":"","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type { DeviceType } from \"../../DeviceInput/InputDevices/deviceEnums\";\r\nimport type { IDeviceInputSystem } from \"../../DeviceInput/inputInterfaces\";\r\nimport type { InternalTexture } from \"../../Materials/Textures/internalTexture\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { ICanvas, IImage } from \"../ICanvas\";\r\nimport type { NativeData, NativeDataStream } from \"./nativeDataStream\";\r\n\r\n/** @internal */\r\nexport interface INativeEngine {\r\n dispose(): void;\r\n\r\n requestAnimationFrame(callback: () => void): void;\r\n\r\n createVertexArray(): NativeData;\r\n\r\n createIndexBuffer(bytes: ArrayBuffer, byteOffset: number, byteLength: number, is32Bits: boolean, dynamic: boolean): NativeData;\r\n recordIndexBuffer(vertexArray: NativeData, indexBuffer: NativeData): void;\r\n updateDynamicIndexBuffer(buffer: NativeData, bytes: ArrayBuffer, byteOffset: number, byteLength: number, startIndex: number): void;\r\n\r\n createVertexBuffer(bytes: ArrayBuffer, byteOffset: number, byteLength: number, dynamic: boolean): NativeData;\r\n recordVertexBuffer(\r\n vertexArray: NativeData,\r\n vertexBuffer: NativeData,\r\n location: number,\r\n byteOffset: number,\r\n byteStride: number,\r\n numElements: number,\r\n type: number,\r\n normalized: boolean,\r\n instanceDivisor: number\r\n ): void;\r\n updateDynamicVertexBuffer(vertexBuffer: NativeData, bytes: ArrayBuffer, byteOffset: number, byteLength: number): void;\r\n\r\n createProgram(vertexShader: string, fragmentShader: string): any;\r\n getUniforms(shaderProgram: any, uniformsNames: string[]): WebGLUniformLocation[];\r\n getAttributes(shaderProgram: any, attributeNames: string[]): number[];\r\n\r\n createTexture(): WebGLTexture;\r\n loadTexture(texture: WebGLTexture, data: ArrayBufferView, generateMips: boolean, invertY: boolean, srgb: boolean, onSuccess: () => void, onError: () => void): void;\r\n loadRawTexture(texture: WebGLTexture, data: ArrayBufferView, width: number, height: number, format: number, generateMips: boolean, invertY: boolean): void;\r\n loadRawTexture2DArray(\r\n texture: WebGLTexture,\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n depth: number,\r\n format: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean\r\n ): void;\r\n loadCubeTexture(texture: WebGLTexture, data: Array<ArrayBufferView>, generateMips: boolean, invertY: boolean, srgb: boolean, onSuccess: () => void, onError: () => void): void;\r\n loadCubeTextureWithMips(texture: WebGLTexture, data: Array<Array<ArrayBufferView>>, invertY: boolean, srgb: boolean, onSuccess: () => void, onError: () => void): void;\r\n getTextureWidth(texture: WebGLTexture): number;\r\n getTextureHeight(texture: WebGLTexture): number;\r\n copyTexture(desination: Nullable<WebGLTexture>, source: Nullable<WebGLTexture>): void;\r\n deleteTexture(texture: Nullable<WebGLTexture>): void;\r\n readTexture(\r\n texture: WebGLTexture,\r\n mipLevel: number,\r\n x: number,\r\n y: number,\r\n width: number,\r\n height: number,\r\n buffer: Nullable<ArrayBuffer>,\r\n bufferOffset: number,\r\n bufferLength: number\r\n ): Promise<ArrayBuffer>;\r\n\r\n createImageBitmap(data: ArrayBufferView | IImage): ImageBitmap;\r\n resizeImageBitmap(image: ImageBitmap, bufferWidth: number, bufferHeight: number): Uint8Array;\r\n\r\n createFrameBuffer(\r\n texture: WebGLTexture,\r\n width: number,\r\n height: number,\r\n format: number,\r\n generateStencilBuffer: boolean,\r\n generateDepthBuffer: boolean,\r\n generateMips: boolean\r\n ): WebGLFramebuffer;\r\n\r\n getRenderWidth(): number;\r\n getRenderHeight(): number;\r\n getHardwareScalingLevel(): number;\r\n setHardwareScalingLevel(level: number): void;\r\n\r\n setViewPort(x: number, y: number, width: number, height: number): void;\r\n\r\n setCommandDataStream(dataStream: NativeDataStream): void;\r\n submitCommands(): void;\r\n}\r\n\r\n/** @internal */\r\ninterface INativeEngineConstructor {\r\n prototype: INativeEngine;\r\n new (): INativeEngine;\r\n\r\n readonly PROTOCOL_VERSION: number;\r\n\r\n readonly CAPS_LIMITS_MAX_TEXTURE_SIZE: number;\r\n readonly CAPS_LIMITS_MAX_TEXTURE_LAYERS: number;\r\n\r\n readonly TEXTURE_NEAREST_NEAREST: number;\r\n readonly TEXTURE_LINEAR_LINEAR: number;\r\n readonly TEXTURE_LINEAR_LINEAR_MIPLINEAR: number;\r\n readonly TEXTURE_NEAREST_NEAREST_MIPNEAREST: number;\r\n readonly TEXTURE_NEAREST_LINEAR_MIPNEAREST: number;\r\n readonly TEXTURE_NEAREST_LINEAR_MIPLINEAR: number;\r\n readonly TEXTURE_NEAREST_LINEAR: number;\r\n readonly TEXTURE_NEAREST_NEAREST_MIPLINEAR: number;\r\n readonly TEXTURE_LINEAR_NEAREST_MIPNEAREST: number;\r\n readonly TEXTURE_LINEAR_NEAREST_MIPLINEAR: number;\r\n readonly TEXTURE_LINEAR_LINEAR_MIPNEAREST: number;\r\n readonly TEXTURE_LINEAR_NEAREST: number;\r\n\r\n readonly DEPTH_TEST_LESS: number;\r\n readonly DEPTH_TEST_LEQUAL: number;\r\n readonly DEPTH_TEST_EQUAL: number;\r\n readonly DEPTH_TEST_GEQUAL: number;\r\n readonly DEPTH_TEST_GREATER: number;\r\n readonly DEPTH_TEST_NOTEQUAL: number;\r\n readonly DEPTH_TEST_NEVER: number;\r\n readonly DEPTH_TEST_ALWAYS: number;\r\n\r\n readonly ADDRESS_MODE_WRAP: number;\r\n readonly ADDRESS_MODE_MIRROR: number;\r\n readonly ADDRESS_MODE_CLAMP: number;\r\n readonly ADDRESS_MODE_BORDER: number;\r\n readonly ADDRESS_MODE_MIRROR_ONCE: number;\r\n\r\n readonly TEXTURE_FORMAT_RGB8: number;\r\n readonly TEXTURE_FORMAT_RGBA8: number;\r\n readonly TEXTURE_FORMAT_RGBA32F: number;\r\n\r\n readonly ATTRIB_TYPE_INT8: number;\r\n readonly ATTRIB_TYPE_UINT8: number;\r\n readonly ATTRIB_TYPE_INT16: number;\r\n readonly ATTRIB_TYPE_UINT16: number;\r\n readonly ATTRIB_TYPE_FLOAT: number;\r\n\r\n readonly ALPHA_DISABLE: number;\r\n readonly ALPHA_ADD: number;\r\n readonly ALPHA_COMBINE: number;\r\n readonly ALPHA_SUBTRACT: number;\r\n readonly ALPHA_MULTIPLY: number;\r\n readonly ALPHA_MAXIMIZED: number;\r\n readonly ALPHA_ONEONE: number;\r\n readonly ALPHA_PREMULTIPLIED: number;\r\n readonly ALPHA_PREMULTIPLIED_PORTERDUFF: number;\r\n readonly ALPHA_INTERPOLATE: number;\r\n readonly ALPHA_SCREENMODE: number;\r\n\r\n readonly STENCIL_TEST_LESS: number;\r\n readonly STENCIL_TEST_LEQUAL: number;\r\n readonly STENCIL_TEST_EQUAL: number;\r\n readonly STENCIL_TEST_GEQUAL: number;\r\n readonly STENCIL_TEST_GREATER: number;\r\n readonly STENCIL_TEST_NOTEQUAL: number;\r\n readonly STENCIL_TEST_NEVER: number;\r\n readonly STENCIL_TEST_ALWAYS: number;\r\n\r\n readonly STENCIL_OP_FAIL_S_ZERO: number;\r\n readonly STENCIL_OP_FAIL_S_KEEP: number;\r\n readonly STENCIL_OP_FAIL_S_REPLACE: number;\r\n readonly STENCIL_OP_FAIL_S_INCR: number;\r\n readonly STENCIL_OP_FAIL_S_INCRSAT: number;\r\n readonly STENCIL_OP_FAIL_S_DECR: number;\r\n readonly STENCIL_OP_FAIL_S_DECRSAT: number;\r\n readonly STENCIL_OP_FAIL_S_INVERT: number;\r\n\r\n readonly STENCIL_OP_FAIL_Z_ZERO: number;\r\n readonly STENCIL_OP_FAIL_Z_KEEP: number;\r\n readonly STENCIL_OP_FAIL_Z_REPLACE: number;\r\n readonly STENCIL_OP_FAIL_Z_INCR: number;\r\n readonly STENCIL_OP_FAIL_Z_INCRSAT: number;\r\n readonly STENCIL_OP_FAIL_Z_DECR: number;\r\n readonly STENCIL_OP_FAIL_Z_DECRSAT: number;\r\n readonly STENCIL_OP_FAIL_Z_INVERT: number;\r\n\r\n readonly STENCIL_OP_PASS_Z_ZERO: number;\r\n readonly STENCIL_OP_PASS_Z_KEEP: number;\r\n readonly STENCIL_OP_PASS_Z_REPLACE: number;\r\n readonly STENCIL_OP_PASS_Z_INCR: number;\r\n readonly STENCIL_OP_PASS_Z_INCRSAT: number;\r\n readonly STENCIL_OP_PASS_Z_DECR: number;\r\n readonly STENCIL_OP_PASS_Z_DECRSAT: number;\r\n readonly STENCIL_OP_PASS_Z_INVERT: number;\r\n\r\n readonly COMMAND_DELETEVERTEXARRAY: NativeData;\r\n readonly COMMAND_DELETEINDEXBUFFER: NativeData;\r\n readonly COMMAND_DELETEVERTEXBUFFER: NativeData;\r\n readonly COMMAND_SETPROGRAM: NativeData;\r\n readonly COMMAND_SETMATRIX: NativeData;\r\n readonly COMMAND_SETMATRIX3X3: NativeData;\r\n readonly COMMAND_SETMATRIX2X2: NativeData;\r\n readonly COMMAND_SETMATRICES: NativeData;\r\n readonly COMMAND_SETINT: NativeData;\r\n readonly COMMAND_SETINTARRAY: NativeData;\r\n readonly COMMAND_SETINTARRAY2: NativeData;\r\n readonly COMMAND_SETINTARRAY3: NativeData;\r\n readonly COMMAND_SETINTARRAY4: NativeData;\r\n readonly COMMAND_SETFLOATARRAY: NativeData;\r\n readonly COMMAND_SETFLOATARRAY2: NativeData;\r\n readonly COMMAND_SETFLOATARRAY3: NativeData;\r\n readonly COMMAND_SETFLOATARRAY4: NativeData;\r\n readonly COMMAND_SETTEXTURESAMPLING: NativeData;\r\n readonly COMMAND_SETTEXTUREWRAPMODE: NativeData;\r\n readonly COMMAND_SETTEXTUREANISOTROPICLEVEL: NativeData;\r\n readonly COMMAND_SETTEXTURE: NativeData;\r\n readonly COMMAND_BINDVERTEXARRAY: NativeData;\r\n readonly COMMAND_SETSTATE: NativeData;\r\n readonly COMMAND_DELETEPROGRAM: NativeData;\r\n readonly COMMAND_SETZOFFSET: NativeData;\r\n readonly COMMAND_SETZOFFSETUNITS: NativeData;\r\n readonly COMMAND_SETDEPTHTEST: NativeData;\r\n readonly COMMAND_SETDEPTHWRITE: NativeData;\r\n readonly COMMAND_SETCOLORWRITE: NativeData;\r\n readonly COMMAND_SETBLENDMODE: NativeData;\r\n readonly COMMAND_SETFLOAT: NativeData;\r\n readonly COMMAND_SETFLOAT2: NativeData;\r\n readonly COMMAND_SETFLOAT3: NativeData;\r\n readonly COMMAND_SETFLOAT4: NativeData;\r\n readonly COMMAND_BINDFRAMEBUFFER: NativeData;\r\n readonly COMMAND_UNBINDFRAMEBUFFER: NativeData;\r\n readonly COMMAND_DELETEFRAMEBUFFER: NativeData;\r\n readonly COMMAND_DRAWINDEXED: NativeData;\r\n readonly COMMAND_DRAW: NativeData;\r\n readonly COMMAND_CLEAR: NativeData;\r\n readonly COMMAND_SETSTENCIL: NativeData;\r\n}\r\n\r\n/** @internal */\r\nexport interface INativeCamera {\r\n createVideo(constraints: MediaTrackConstraints): any;\r\n updateVideoTexture(texture: Nullable<InternalTexture>, video: HTMLVideoElement, invertY: boolean): void;\r\n}\r\n\r\n/** @internal */\r\ninterface INativeCameraConstructor {\r\n prototype: INativeCamera;\r\n new (): INativeCamera;\r\n}\r\n\r\n/** @internal */\r\ninterface INativeCanvasConstructor {\r\n prototype: ICanvas;\r\n new (): ICanvas;\r\n\r\n loadTTFAsync(fontName: string, buffer: ArrayBuffer): void;\r\n}\r\n\r\n/** @internal */\r\ninterface INativeImageConstructor {\r\n prototype: IImage;\r\n new (): IImage;\r\n}\r\n\r\n/** @internal */\r\ninterface IDeviceInputSystemConstructor {\r\n prototype: IDeviceInputSystem;\r\n new (\r\n onDeviceConnected: (deviceType: DeviceType, deviceSlot: number) => void,\r\n onDeviceDisconnected: (deviceType: DeviceType, deviceSlot: number) => void,\r\n onInputChanged: (deviceType: DeviceType, deviceSlot: number, inputIndex: number, currentState: number) => void\r\n ): IDeviceInputSystem;\r\n}\r\n\r\n/** @internal */\r\nexport interface INativeDataStream {\r\n writeBuffer(buffer: ArrayBuffer, length: number): void;\r\n}\r\n\r\n/** @internal */\r\ninterface INativeDataStreamConstructor {\r\n prototype: INativeDataStream;\r\n new (requestFlushCallback: () => void): INativeDataStream;\r\n\r\n readonly VALIDATION_ENABLED: boolean;\r\n readonly VALIDATION_UINT_32: number;\r\n readonly VALIDATION_INT_32: number;\r\n readonly VALIDATION_FLOAT_32: number;\r\n readonly VALIDATION_UINT_32_ARRAY: number;\r\n readonly VALIDATION_INT_32_ARRAY: number;\r\n readonly VALIDATION_FLOAT_32_ARRAY: number;\r\n readonly VALIDATION_NATIVE_DATA: number;\r\n readonly VALIDATION_BOOLEAN: number;\r\n}\r\n\r\n/** @internal */\r\nexport interface INative {\r\n Engine: INativeEngineConstructor;\r\n Camera: INativeCameraConstructor;\r\n Canvas: INativeCanvasConstructor;\r\n Image: INativeImageConstructor;\r\n XMLHttpRequest: any; // TODO: how to do this?\r\n DeviceInputSystem: IDeviceInputSystemConstructor;\r\n NativeDataStream: INativeDataStreamConstructor;\r\n}\r\n"]}
1
+ {"version":3,"file":"nativeInterfaces.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Engines/Native/nativeInterfaces.ts"],"names":[],"mappings":"","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type { DeviceType } from \"../../DeviceInput/InputDevices/deviceEnums\";\r\nimport type { IDeviceInputSystem } from \"../../DeviceInput/inputInterfaces\";\r\nimport type { InternalTexture } from \"../../Materials/Textures/internalTexture\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { ICanvas, IImage } from \"../ICanvas\";\r\nimport type { NativeData, NativeDataStream } from \"./nativeDataStream\";\r\n\r\nexport type NativeTexture = NativeData;\r\nexport type NativeFramebuffer = NativeData;\r\nexport type NativeVertexArrayObject = NativeData;\r\nexport type NativeProgram = NativeData;\r\nexport type NativeUniform = NativeData;\r\n\r\n/** @internal */\r\nexport interface INativeEngine {\r\n dispose(): void;\r\n\r\n requestAnimationFrame(callback: () => void): void;\r\n\r\n createVertexArray(): NativeData;\r\n\r\n createIndexBuffer(bytes: ArrayBuffer, byteOffset: number, byteLength: number, is32Bits: boolean, dynamic: boolean): NativeData;\r\n recordIndexBuffer(vertexArray: NativeData, indexBuffer: NativeData): void;\r\n updateDynamicIndexBuffer(buffer: NativeData, bytes: ArrayBuffer, byteOffset: number, byteLength: number, startIndex: number): void;\r\n\r\n createVertexBuffer(bytes: ArrayBuffer, byteOffset: number, byteLength: number, dynamic: boolean): NativeData;\r\n recordVertexBuffer(\r\n vertexArray: NativeData,\r\n vertexBuffer: NativeData,\r\n location: number,\r\n byteOffset: number,\r\n byteStride: number,\r\n numElements: number,\r\n type: number,\r\n normalized: boolean,\r\n instanceDivisor: number\r\n ): void;\r\n updateDynamicVertexBuffer(vertexBuffer: NativeData, bytes: ArrayBuffer, byteOffset: number, byteLength: number): void;\r\n\r\n createProgram(vertexShader: string, fragmentShader: string): NativeProgram;\r\n getUniforms(shaderProgram: NativeProgram, uniformsNames: string[]): WebGLUniformLocation[];\r\n getAttributes(shaderProgram: NativeProgram, attributeNames: string[]): number[];\r\n\r\n createTexture(): NativeTexture;\r\n initializeTexture(texture: NativeTexture, width: number, height: number, hasMips: boolean, format: number, renderTarget: boolean, srgb: boolean): void;\r\n loadTexture(texture: NativeTexture, data: ArrayBufferView, generateMips: boolean, invertY: boolean, srgb: boolean, onSuccess: () => void, onError: () => void): void;\r\n loadRawTexture(texture: NativeTexture, data: ArrayBufferView, width: number, height: number, format: number, generateMips: boolean, invertY: boolean): void;\r\n loadRawTexture2DArray(\r\n texture: NativeTexture,\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n depth: number,\r\n format: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean\r\n ): void;\r\n loadCubeTexture(texture: NativeTexture, data: Array<ArrayBufferView>, generateMips: boolean, invertY: boolean, srgb: boolean, onSuccess: () => void, onError: () => void): void;\r\n loadCubeTextureWithMips(texture: NativeTexture, data: Array<Array<ArrayBufferView>>, invertY: boolean, srgb: boolean, onSuccess: () => void, onError: () => void): void;\r\n getTextureWidth(texture: NativeTexture): number;\r\n getTextureHeight(texture: NativeTexture): number;\r\n copyTexture(desination: NativeTexture, source: NativeTexture): void;\r\n deleteTexture(texture: NativeTexture): void;\r\n readTexture(\r\n texture: NativeTexture,\r\n mipLevel: number,\r\n x: number,\r\n y: number,\r\n width: number,\r\n height: number,\r\n buffer: Nullable<ArrayBuffer>,\r\n bufferOffset: number,\r\n bufferLength: number\r\n ): Promise<ArrayBuffer>;\r\n\r\n createImageBitmap(data: ArrayBufferView | IImage): ImageBitmap;\r\n resizeImageBitmap(image: ImageBitmap, bufferWidth: number, bufferHeight: number): Uint8Array;\r\n\r\n createFrameBuffer(texture: Nullable<NativeTexture>, width: number, height: number, generateStencilBuffer: boolean, generateDepthBuffer: boolean): NativeFramebuffer;\r\n\r\n getRenderWidth(): number;\r\n getRenderHeight(): number;\r\n getHardwareScalingLevel(): number;\r\n setHardwareScalingLevel(level: number): void;\r\n\r\n setViewPort(x: number, y: number, width: number, height: number): void;\r\n\r\n setCommandDataStream(dataStream: NativeDataStream): void;\r\n submitCommands(): void;\r\n}\r\n\r\n/** @internal */\r\ninterface INativeEngineConstructor {\r\n prototype: INativeEngine;\r\n new (): INativeEngine;\r\n\r\n readonly PROTOCOL_VERSION: number;\r\n\r\n readonly CAPS_LIMITS_MAX_TEXTURE_SIZE: number;\r\n readonly CAPS_LIMITS_MAX_TEXTURE_LAYERS: number;\r\n\r\n readonly TEXTURE_NEAREST_NEAREST: number;\r\n readonly TEXTURE_LINEAR_LINEAR: number;\r\n readonly TEXTURE_LINEAR_LINEAR_MIPLINEAR: number;\r\n readonly TEXTURE_NEAREST_NEAREST_MIPNEAREST: number;\r\n readonly TEXTURE_NEAREST_LINEAR_MIPNEAREST: number;\r\n readonly TEXTURE_NEAREST_LINEAR_MIPLINEAR: number;\r\n readonly TEXTURE_NEAREST_LINEAR: number;\r\n readonly TEXTURE_NEAREST_NEAREST_MIPLINEAR: number;\r\n readonly TEXTURE_LINEAR_NEAREST_MIPNEAREST: number;\r\n readonly TEXTURE_LINEAR_NEAREST_MIPLINEAR: number;\r\n readonly TEXTURE_LINEAR_LINEAR_MIPNEAREST: number;\r\n readonly TEXTURE_LINEAR_NEAREST: number;\r\n\r\n readonly DEPTH_TEST_LESS: number;\r\n readonly DEPTH_TEST_LEQUAL: number;\r\n readonly DEPTH_TEST_EQUAL: number;\r\n readonly DEPTH_TEST_GEQUAL: number;\r\n readonly DEPTH_TEST_GREATER: number;\r\n readonly DEPTH_TEST_NOTEQUAL: number;\r\n readonly DEPTH_TEST_NEVER: number;\r\n readonly DEPTH_TEST_ALWAYS: number;\r\n\r\n readonly ADDRESS_MODE_WRAP: number;\r\n readonly ADDRESS_MODE_MIRROR: number;\r\n readonly ADDRESS_MODE_CLAMP: number;\r\n readonly ADDRESS_MODE_BORDER: number;\r\n readonly ADDRESS_MODE_MIRROR_ONCE: number;\r\n\r\n readonly TEXTURE_FORMAT_RGB8: number;\r\n readonly TEXTURE_FORMAT_RGBA8: number;\r\n readonly TEXTURE_FORMAT_RGBA16F: number;\r\n readonly TEXTURE_FORMAT_RGBA32F: number;\r\n\r\n readonly ATTRIB_TYPE_INT8: number;\r\n readonly ATTRIB_TYPE_UINT8: number;\r\n readonly ATTRIB_TYPE_INT16: number;\r\n readonly ATTRIB_TYPE_UINT16: number;\r\n readonly ATTRIB_TYPE_FLOAT: number;\r\n\r\n readonly ALPHA_DISABLE: number;\r\n readonly ALPHA_ADD: number;\r\n readonly ALPHA_COMBINE: number;\r\n readonly ALPHA_SUBTRACT: number;\r\n readonly ALPHA_MULTIPLY: number;\r\n readonly ALPHA_MAXIMIZED: number;\r\n readonly ALPHA_ONEONE: number;\r\n readonly ALPHA_PREMULTIPLIED: number;\r\n readonly ALPHA_PREMULTIPLIED_PORTERDUFF: number;\r\n readonly ALPHA_INTERPOLATE: number;\r\n readonly ALPHA_SCREENMODE: number;\r\n\r\n readonly STENCIL_TEST_LESS: number;\r\n readonly STENCIL_TEST_LEQUAL: number;\r\n readonly STENCIL_TEST_EQUAL: number;\r\n readonly STENCIL_TEST_GEQUAL: number;\r\n readonly STENCIL_TEST_GREATER: number;\r\n readonly STENCIL_TEST_NOTEQUAL: number;\r\n readonly STENCIL_TEST_NEVER: number;\r\n readonly STENCIL_TEST_ALWAYS: number;\r\n\r\n readonly STENCIL_OP_FAIL_S_ZERO: number;\r\n readonly STENCIL_OP_FAIL_S_KEEP: number;\r\n readonly STENCIL_OP_FAIL_S_REPLACE: number;\r\n readonly STENCIL_OP_FAIL_S_INCR: number;\r\n readonly STENCIL_OP_FAIL_S_INCRSAT: number;\r\n readonly STENCIL_OP_FAIL_S_DECR: number;\r\n readonly STENCIL_OP_FAIL_S_DECRSAT: number;\r\n readonly STENCIL_OP_FAIL_S_INVERT: number;\r\n\r\n readonly STENCIL_OP_FAIL_Z_ZERO: number;\r\n readonly STENCIL_OP_FAIL_Z_KEEP: number;\r\n readonly STENCIL_OP_FAIL_Z_REPLACE: number;\r\n readonly STENCIL_OP_FAIL_Z_INCR: number;\r\n readonly STENCIL_OP_FAIL_Z_INCRSAT: number;\r\n readonly STENCIL_OP_FAIL_Z_DECR: number;\r\n readonly STENCIL_OP_FAIL_Z_DECRSAT: number;\r\n readonly STENCIL_OP_FAIL_Z_INVERT: number;\r\n\r\n readonly STENCIL_OP_PASS_Z_ZERO: number;\r\n readonly STENCIL_OP_PASS_Z_KEEP: number;\r\n readonly STENCIL_OP_PASS_Z_REPLACE: number;\r\n readonly STENCIL_OP_PASS_Z_INCR: number;\r\n readonly STENCIL_OP_PASS_Z_INCRSAT: number;\r\n readonly STENCIL_OP_PASS_Z_DECR: number;\r\n readonly STENCIL_OP_PASS_Z_DECRSAT: number;\r\n readonly STENCIL_OP_PASS_Z_INVERT: number;\r\n\r\n readonly COMMAND_DELETEVERTEXARRAY: NativeData;\r\n readonly COMMAND_DELETEINDEXBUFFER: NativeData;\r\n readonly COMMAND_DELETEVERTEXBUFFER: NativeData;\r\n readonly COMMAND_SETPROGRAM: NativeData;\r\n readonly COMMAND_SETMATRIX: NativeData;\r\n readonly COMMAND_SETMATRIX3X3: NativeData;\r\n readonly COMMAND_SETMATRIX2X2: NativeData;\r\n readonly COMMAND_SETMATRICES: NativeData;\r\n readonly COMMAND_SETINT: NativeData;\r\n readonly COMMAND_SETINTARRAY: NativeData;\r\n readonly COMMAND_SETINTARRAY2: NativeData;\r\n readonly COMMAND_SETINTARRAY3: NativeData;\r\n readonly COMMAND_SETINTARRAY4: NativeData;\r\n readonly COMMAND_SETFLOATARRAY: NativeData;\r\n readonly COMMAND_SETFLOATARRAY2: NativeData;\r\n readonly COMMAND_SETFLOATARRAY3: NativeData;\r\n readonly COMMAND_SETFLOATARRAY4: NativeData;\r\n readonly COMMAND_SETTEXTURESAMPLING: NativeData;\r\n readonly COMMAND_SETTEXTUREWRAPMODE: NativeData;\r\n readonly COMMAND_SETTEXTUREANISOTROPICLEVEL: NativeData;\r\n readonly COMMAND_SETTEXTURE: NativeData;\r\n readonly COMMAND_BINDVERTEXARRAY: NativeData;\r\n readonly COMMAND_SETSTATE: NativeData;\r\n readonly COMMAND_DELETEPROGRAM: NativeData;\r\n readonly COMMAND_SETZOFFSET: NativeData;\r\n readonly COMMAND_SETZOFFSETUNITS: NativeData;\r\n readonly COMMAND_SETDEPTHTEST: NativeData;\r\n readonly COMMAND_SETDEPTHWRITE: NativeData;\r\n readonly COMMAND_SETCOLORWRITE: NativeData;\r\n readonly COMMAND_SETBLENDMODE: NativeData;\r\n readonly COMMAND_SETFLOAT: NativeData;\r\n readonly COMMAND_SETFLOAT2: NativeData;\r\n readonly COMMAND_SETFLOAT3: NativeData;\r\n readonly COMMAND_SETFLOAT4: NativeData;\r\n readonly COMMAND_BINDFRAMEBUFFER: NativeData;\r\n readonly COMMAND_UNBINDFRAMEBUFFER: NativeData;\r\n readonly COMMAND_DELETEFRAMEBUFFER: NativeData;\r\n readonly COMMAND_DRAWINDEXED: NativeData;\r\n readonly COMMAND_DRAW: NativeData;\r\n readonly COMMAND_CLEAR: NativeData;\r\n readonly COMMAND_SETSTENCIL: NativeData;\r\n}\r\n\r\n/** @internal */\r\nexport interface INativeCamera {\r\n createVideo(constraints: MediaTrackConstraints): any;\r\n updateVideoTexture(texture: Nullable<InternalTexture>, video: HTMLVideoElement, invertY: boolean): void;\r\n}\r\n\r\n/** @internal */\r\ninterface INativeCameraConstructor {\r\n prototype: INativeCamera;\r\n new (): INativeCamera;\r\n}\r\n\r\n/** @internal */\r\ninterface INativeCanvasConstructor {\r\n prototype: ICanvas;\r\n new (): ICanvas;\r\n\r\n loadTTFAsync(fontName: string, buffer: ArrayBuffer): void;\r\n}\r\n\r\n/** @internal */\r\ninterface INativeImageConstructor {\r\n prototype: IImage;\r\n new (): IImage;\r\n}\r\n\r\n/** @internal */\r\ninterface IDeviceInputSystemConstructor {\r\n prototype: IDeviceInputSystem;\r\n new (\r\n onDeviceConnected: (deviceType: DeviceType, deviceSlot: number) => void,\r\n onDeviceDisconnected: (deviceType: DeviceType, deviceSlot: number) => void,\r\n onInputChanged: (deviceType: DeviceType, deviceSlot: number, inputIndex: number, currentState: number) => void\r\n ): IDeviceInputSystem;\r\n}\r\n\r\n/** @internal */\r\nexport interface INativeDataStream {\r\n writeBuffer(buffer: ArrayBuffer, length: number): void;\r\n}\r\n\r\n/** @internal */\r\ninterface INativeDataStreamConstructor {\r\n prototype: INativeDataStream;\r\n new (requestFlushCallback: () => void): INativeDataStream;\r\n\r\n readonly VALIDATION_ENABLED: boolean;\r\n readonly VALIDATION_UINT_32: number;\r\n readonly VALIDATION_INT_32: number;\r\n readonly VALIDATION_FLOAT_32: number;\r\n readonly VALIDATION_UINT_32_ARRAY: number;\r\n readonly VALIDATION_INT_32_ARRAY: number;\r\n readonly VALIDATION_FLOAT_32_ARRAY: number;\r\n readonly VALIDATION_NATIVE_DATA: number;\r\n readonly VALIDATION_BOOLEAN: number;\r\n}\r\n\r\n/** @internal */\r\nexport interface INative {\r\n Engine: INativeEngineConstructor;\r\n Camera: INativeCameraConstructor;\r\n Canvas: INativeCanvasConstructor;\r\n Image: INativeImageConstructor;\r\n XMLHttpRequest: any; // TODO: how to do this?\r\n DeviceInputSystem: IDeviceInputSystemConstructor;\r\n NativeDataStream: INativeDataStreamConstructor;\r\n}\r\n"]}
@@ -0,0 +1,252 @@
1
+ import type { Nullable } from "../../types";
2
+ import type { Effect } from "../../Materials/effect";
3
+ import type { IMatrixLike, IVector2Like, IVector3Like, IVector4Like, IColor3Like, IColor4Like, IQuaternionLike } from "../../Maths/math.like";
4
+ import type { IPipelineContext } from "../IPipelineContext";
5
+ import type { NativeEngine } from "../nativeEngine";
6
+ export declare class NativePipelineContext implements IPipelineContext {
7
+ isAsync: boolean;
8
+ isReady: boolean;
9
+ _getVertexShaderCode(): string | null;
10
+ _getFragmentShaderCode(): string | null;
11
+ _handlesSpectorRebuildCallback(onCompiled: (compiledObject: any) => void): void;
12
+ nativeProgram: any;
13
+ private _engine;
14
+ private _valueCache;
15
+ private _uniforms;
16
+ constructor(engine: NativeEngine);
17
+ _fillEffectInformation(effect: Effect, uniformBuffersNames: {
18
+ [key: string]: number;
19
+ }, uniformsNames: string[], uniforms: {
20
+ [key: string]: Nullable<WebGLUniformLocation>;
21
+ }, samplerList: string[], samplers: {
22
+ [key: string]: number;
23
+ }, attributesNames: string[], attributes: number[]): void;
24
+ /**
25
+ * Release all associated resources.
26
+ **/
27
+ dispose(): void;
28
+ /**
29
+ * @internal
30
+ */
31
+ _cacheMatrix(uniformName: string, matrix: IMatrixLike): boolean;
32
+ /**
33
+ * @internal
34
+ */
35
+ _cacheFloat2(uniformName: string, x: number, y: number): boolean;
36
+ /**
37
+ * @internal
38
+ */
39
+ _cacheFloat3(uniformName: string, x: number, y: number, z: number): boolean;
40
+ /**
41
+ * @internal
42
+ */
43
+ _cacheFloat4(uniformName: string, x: number, y: number, z: number, w: number): boolean;
44
+ /**
45
+ * Sets an integer value on a uniform variable.
46
+ * @param uniformName Name of the variable.
47
+ * @param value Value to be set.
48
+ */
49
+ setInt(uniformName: string, value: number): void;
50
+ /**
51
+ * Sets a int2 on a uniform variable.
52
+ * @param uniformName Name of the variable.
53
+ * @param x First int in int2.
54
+ * @param y Second int in int2.
55
+ */
56
+ setInt2(uniformName: string, x: number, y: number): void;
57
+ /**
58
+ * Sets a int3 on a uniform variable.
59
+ * @param uniformName Name of the variable.
60
+ * @param x First int in int3.
61
+ * @param y Second int in int3.
62
+ * @param z Third int in int3.
63
+ */
64
+ setInt3(uniformName: string, x: number, y: number, z: number): void;
65
+ /**
66
+ * Sets a int4 on a uniform variable.
67
+ * @param uniformName Name of the variable.
68
+ * @param x First int in int4.
69
+ * @param y Second int in int4.
70
+ * @param z Third int in int4.
71
+ * @param w Fourth int in int4.
72
+ */
73
+ setInt4(uniformName: string, x: number, y: number, z: number, w: number): void;
74
+ /**
75
+ * Sets an int array on a uniform variable.
76
+ * @param uniformName Name of the variable.
77
+ * @param array array to be set.
78
+ */
79
+ setIntArray(uniformName: string, array: Int32Array): void;
80
+ /**
81
+ * Sets an int array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
82
+ * @param uniformName Name of the variable.
83
+ * @param array array to be set.
84
+ */
85
+ setIntArray2(uniformName: string, array: Int32Array): void;
86
+ /**
87
+ * Sets an int array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
88
+ * @param uniformName Name of the variable.
89
+ * @param array array to be set.
90
+ */
91
+ setIntArray3(uniformName: string, array: Int32Array): void;
92
+ /**
93
+ * Sets an int array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
94
+ * @param uniformName Name of the variable.
95
+ * @param array array to be set.
96
+ */
97
+ setIntArray4(uniformName: string, array: Int32Array): void;
98
+ /**
99
+ * Sets an float array on a uniform variable.
100
+ * @param uniformName Name of the variable.
101
+ * @param array array to be set.
102
+ */
103
+ setFloatArray(uniformName: string, array: Float32Array): void;
104
+ /**
105
+ * Sets an float array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
106
+ * @param uniformName Name of the variable.
107
+ * @param array array to be set.
108
+ */
109
+ setFloatArray2(uniformName: string, array: Float32Array): void;
110
+ /**
111
+ * Sets an float array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
112
+ * @param uniformName Name of the variable.
113
+ * @param array array to be set.
114
+ */
115
+ setFloatArray3(uniformName: string, array: Float32Array): void;
116
+ /**
117
+ * Sets an float array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
118
+ * @param uniformName Name of the variable.
119
+ * @param array array to be set.
120
+ */
121
+ setFloatArray4(uniformName: string, array: Float32Array): void;
122
+ /**
123
+ * Sets an array on a uniform variable.
124
+ * @param uniformName Name of the variable.
125
+ * @param array array to be set.
126
+ */
127
+ setArray(uniformName: string, array: number[]): void;
128
+ /**
129
+ * Sets an array 2 on a uniform variable. (Array is specified as single array eg. [1,2,3,4] will result in [[1,2],[3,4]] in the shader)
130
+ * @param uniformName Name of the variable.
131
+ * @param array array to be set.
132
+ */
133
+ setArray2(uniformName: string, array: number[]): void;
134
+ /**
135
+ * Sets an array 3 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6] will result in [[1,2,3],[4,5,6]] in the shader)
136
+ * @param uniformName Name of the variable.
137
+ * @param array array to be set.
138
+ * @returns this effect.
139
+ */
140
+ setArray3(uniformName: string, array: number[]): void;
141
+ /**
142
+ * Sets an array 4 on a uniform variable. (Array is specified as single array eg. [1,2,3,4,5,6,7,8] will result in [[1,2,3,4],[5,6,7,8]] in the shader)
143
+ * @param uniformName Name of the variable.
144
+ * @param array array to be set.
145
+ */
146
+ setArray4(uniformName: string, array: number[]): void;
147
+ /**
148
+ * Sets matrices on a uniform variable.
149
+ * @param uniformName Name of the variable.
150
+ * @param matrices matrices to be set.
151
+ */
152
+ setMatrices(uniformName: string, matrices: Float32Array): void;
153
+ /**
154
+ * Sets matrix on a uniform variable.
155
+ * @param uniformName Name of the variable.
156
+ * @param matrix matrix to be set.
157
+ */
158
+ setMatrix(uniformName: string, matrix: IMatrixLike): void;
159
+ /**
160
+ * Sets a 3x3 matrix on a uniform variable. (Specified as [1,2,3,4,5,6,7,8,9] will result in [1,2,3][4,5,6][7,8,9] matrix)
161
+ * @param uniformName Name of the variable.
162
+ * @param matrix matrix to be set.
163
+ */
164
+ setMatrix3x3(uniformName: string, matrix: Float32Array): void;
165
+ /**
166
+ * Sets a 2x2 matrix on a uniform variable. (Specified as [1,2,3,4] will result in [1,2][3,4] matrix)
167
+ * @param uniformName Name of the variable.
168
+ * @param matrix matrix to be set.
169
+ */
170
+ setMatrix2x2(uniformName: string, matrix: Float32Array): void;
171
+ /**
172
+ * Sets a float on a uniform variable.
173
+ * @param uniformName Name of the variable.
174
+ * @param value value to be set.
175
+ * @returns this effect.
176
+ */
177
+ setFloat(uniformName: string, value: number): void;
178
+ /**
179
+ * Sets a boolean on a uniform variable.
180
+ * @param uniformName Name of the variable.
181
+ * @param bool value to be set.
182
+ */
183
+ setBool(uniformName: string, bool: boolean): void;
184
+ /**
185
+ * Sets a Vector2 on a uniform variable.
186
+ * @param uniformName Name of the variable.
187
+ * @param vector2 vector2 to be set.
188
+ */
189
+ setVector2(uniformName: string, vector2: IVector2Like): void;
190
+ /**
191
+ * Sets a float2 on a uniform variable.
192
+ * @param uniformName Name of the variable.
193
+ * @param x First float in float2.
194
+ * @param y Second float in float2.
195
+ */
196
+ setFloat2(uniformName: string, x: number, y: number): void;
197
+ /**
198
+ * Sets a Vector3 on a uniform variable.
199
+ * @param uniformName Name of the variable.
200
+ * @param vector3 Value to be set.
201
+ */
202
+ setVector3(uniformName: string, vector3: IVector3Like): void;
203
+ /**
204
+ * Sets a float3 on a uniform variable.
205
+ * @param uniformName Name of the variable.
206
+ * @param x First float in float3.
207
+ * @param y Second float in float3.
208
+ * @param z Third float in float3.
209
+ */
210
+ setFloat3(uniformName: string, x: number, y: number, z: number): void;
211
+ /**
212
+ * Sets a Vector4 on a uniform variable.
213
+ * @param uniformName Name of the variable.
214
+ * @param vector4 Value to be set.
215
+ */
216
+ setVector4(uniformName: string, vector4: IVector4Like): void;
217
+ /**
218
+ * Sets a Quaternion on a uniform variable.
219
+ * @param uniformName Name of the variable.
220
+ * @param quaternion Value to be set.
221
+ */
222
+ setQuaternion(uniformName: string, quaternion: IQuaternionLike): void;
223
+ /**
224
+ * Sets a float4 on a uniform variable.
225
+ * @param uniformName Name of the variable.
226
+ * @param x First float in float4.
227
+ * @param y Second float in float4.
228
+ * @param z Third float in float4.
229
+ * @param w Fourth float in float4.
230
+ * @returns this effect.
231
+ */
232
+ setFloat4(uniformName: string, x: number, y: number, z: number, w: number): void;
233
+ /**
234
+ * Sets a Color3 on a uniform variable.
235
+ * @param uniformName Name of the variable.
236
+ * @param color3 Value to be set.
237
+ */
238
+ setColor3(uniformName: string, color3: IColor3Like): void;
239
+ /**
240
+ * Sets a Color4 on a uniform variable.
241
+ * @param uniformName Name of the variable.
242
+ * @param color3 Value to be set.
243
+ * @param alpha Alpha value to be set.
244
+ */
245
+ setColor4(uniformName: string, color3: IColor3Like, alpha: number): void;
246
+ /**
247
+ * Sets a Color4 on a uniform variable
248
+ * @param uniformName defines the name of the variable
249
+ * @param color4 defines the value to be set
250
+ */
251
+ setDirectColor4(uniformName: string, color4: IColor4Like): void;
252
+ }