@babylonjs/core 5.8.0 → 5.9.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 (111) hide show
  1. package/Buffers/buffer.js +2 -3
  2. package/Buffers/buffer.js.map +1 -1
  3. package/Culling/ray.js.map +1 -1
  4. package/Engines/Extensions/engine.rawTexture.js +2 -0
  5. package/Engines/Extensions/engine.rawTexture.js.map +1 -1
  6. package/Engines/Processors/shaderCodeNode.js +3 -4
  7. package/Engines/Processors/shaderCodeNode.js.map +1 -1
  8. package/Engines/engine.d.ts +2 -31
  9. package/Engines/nullEngine.js +3 -1
  10. package/Engines/nullEngine.js.map +1 -1
  11. package/Engines/thinEngine.js +2 -2
  12. package/Engines/thinEngine.js.map +1 -1
  13. package/Gizmos/gizmo.js +8 -2
  14. package/Gizmos/gizmo.js.map +1 -1
  15. package/Inputs/scene.inputManager.js +5 -2
  16. package/Inputs/scene.inputManager.js.map +1 -1
  17. package/Lights/shadowLight.d.ts +2 -0
  18. package/Lights/shadowLight.js +8 -0
  19. package/Lights/shadowLight.js.map +1 -1
  20. package/Loading/Plugins/babylonFileLoader.js +5 -2
  21. package/Loading/Plugins/babylonFileLoader.js.map +1 -1
  22. package/Loading/sceneLoader.js +1 -2
  23. package/Loading/sceneLoader.js.map +1 -1
  24. package/Materials/Node/nodeMaterial.d.ts +1 -1
  25. package/Materials/Node/nodeMaterial.js +1 -0
  26. package/Materials/Node/nodeMaterial.js.map +1 -1
  27. package/Materials/Node/nodeMaterialBuildState.js +2 -3
  28. package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
  29. package/Materials/Textures/Loaders/basisTextureLoader.js +1 -2
  30. package/Materials/Textures/Loaders/basisTextureLoader.js.map +1 -1
  31. package/Materials/Textures/Loaders/ddsTextureLoader.js +1 -2
  32. package/Materials/Textures/Loaders/ddsTextureLoader.js.map +1 -1
  33. package/Materials/Textures/Loaders/envTextureLoader.js +1 -2
  34. package/Materials/Textures/Loaders/envTextureLoader.js.map +1 -1
  35. package/Materials/Textures/Loaders/hdrTextureLoader.js +1 -2
  36. package/Materials/Textures/Loaders/hdrTextureLoader.js.map +1 -1
  37. package/Materials/Textures/Loaders/ktxTextureLoader.js +1 -2
  38. package/Materials/Textures/Loaders/ktxTextureLoader.js.map +1 -1
  39. package/Materials/Textures/Loaders/tgaTextureLoader.js +1 -2
  40. package/Materials/Textures/Loaders/tgaTextureLoader.js.map +1 -1
  41. package/Materials/Textures/cubeTexture.d.ts +2 -1
  42. package/Materials/Textures/cubeTexture.js +2 -2
  43. package/Materials/Textures/cubeTexture.js.map +1 -1
  44. package/Materials/Textures/texture.d.ts +5 -2
  45. package/Materials/Textures/texture.js +15 -11
  46. package/Materials/Textures/texture.js.map +1 -1
  47. package/Materials/effect.d.ts +1 -0
  48. package/Materials/effect.js +5 -0
  49. package/Materials/effect.js.map +1 -1
  50. package/Maths/math.vector.d.ts +45 -0
  51. package/Maths/math.vector.js +92 -7
  52. package/Maths/math.vector.js.map +1 -1
  53. package/Meshes/abstractMesh.js +2 -3
  54. package/Meshes/abstractMesh.js.map +1 -1
  55. package/Meshes/geometry.js +1 -1
  56. package/Meshes/geometry.js.map +1 -1
  57. package/Meshes/instancedMesh.js +12 -9
  58. package/Meshes/instancedMesh.js.map +1 -1
  59. package/Meshes/linesMesh.js +3 -0
  60. package/Meshes/linesMesh.js.map +1 -1
  61. package/Meshes/mesh.js +2 -2
  62. package/Meshes/mesh.js.map +1 -1
  63. package/Misc/deepCopier.js +1 -2
  64. package/Misc/deepCopier.js.map +1 -1
  65. package/Misc/index.d.ts +0 -1
  66. package/Misc/index.js +0 -1
  67. package/Misc/index.js.map +1 -1
  68. package/Misc/reflector.js +1 -2
  69. package/Misc/reflector.js.map +1 -1
  70. package/Misc/sceneSerializer.js +7 -2
  71. package/Misc/sceneSerializer.js.map +1 -1
  72. package/Misc/stringTools.d.ts +2 -0
  73. package/Misc/stringTools.js +4 -2
  74. package/Misc/stringTools.js.map +1 -1
  75. package/Misc/tools.d.ts +0 -17
  76. package/Misc/tools.js +0 -25
  77. package/Misc/tools.js.map +1 -1
  78. package/Navigation/Plugins/recastJSPlugin.js +1 -1
  79. package/Navigation/Plugins/recastJSPlugin.js.map +1 -1
  80. package/Particles/pointsCloudSystem.d.ts +12 -0
  81. package/Particles/pointsCloudSystem.js +30 -0
  82. package/Particles/pointsCloudSystem.js.map +1 -1
  83. package/Particles/solidParticleSystem.js +6 -7
  84. package/Particles/solidParticleSystem.js.map +1 -1
  85. package/Rendering/edgesRenderer.js +1 -2
  86. package/Rendering/edgesRenderer.js.map +1 -1
  87. package/Rendering/geometryBufferRenderer.d.ts +6 -2
  88. package/Rendering/geometryBufferRenderer.js +209 -18
  89. package/Rendering/geometryBufferRenderer.js.map +1 -1
  90. package/Shaders/default.fragment.js +1 -1
  91. package/Shaders/default.fragment.js.map +1 -1
  92. package/Shaders/geometry.fragment.d.ts +1 -0
  93. package/Shaders/geometry.fragment.js +2 -1
  94. package/Shaders/geometry.fragment.js.map +1 -1
  95. package/Shaders/geometry.vertex.js +1 -1
  96. package/Shaders/geometry.vertex.js.map +1 -1
  97. package/Shaders/pbr.fragment.js +1 -1
  98. package/Shaders/pbr.fragment.js.map +1 -1
  99. package/abstractScene.d.ts +1 -0
  100. package/abstractScene.js +1 -0
  101. package/abstractScene.js.map +1 -1
  102. package/package.json +1 -1
  103. package/scene.d.ts +6 -0
  104. package/scene.js +8 -6
  105. package/scene.js.map +1 -1
  106. package/Misc/promise.d.ts +0 -11
  107. package/Misc/promise.js +0 -230
  108. package/Misc/promise.js.map +0 -1
  109. package/Misc/sliceTools.d.ts +0 -22
  110. package/Misc/sliceTools.js +0 -37
  111. package/Misc/sliceTools.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"engine.rawTexture.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/Engines/Extensions/engine.rawTexture.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAA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C,oBAAoB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACxC,4BAA4B;QAC5B,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAC3B,CAAC,CAAC;AACN,CAAC;AAED,UAAU,CAAC,SAAS,CAAC,uBAAuB,GAAG,6BAA6B,CAAC,KAAK,CAAC,CAAC;AACpF,UAAU,CAAC,SAAS,CAAC,kBAAkB,GAAG,6BAA6B,CAAC,IAAI,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"../../types\";\r\nimport { InternalTexture, InternalTextureSource } from \"../../Materials/Textures/internalTexture\";\r\nimport { Logger } from \"../../Misc/logger\";\r\nimport { Tools } from \"../../Misc/tools\";\r\nimport type { Scene } from \"../../scene\";\r\nimport { Constants } from \"../constants\";\r\nimport { ThinEngine } from \"../thinEngine\";\r\nimport type { IWebRequest } from \"../../Misc/interfaces/iWebRequest\";\r\n\r\ndeclare module \"../../Engines/thinEngine\" {\r\n export interface ThinEngine {\r\n /**\r\n * Creates a raw texture\r\n * @param data defines the data to store in the texture\r\n * @param width defines the width of the texture\r\n * @param height defines the height of the texture\r\n * @param format defines the format of the data\r\n * @param generateMipMaps defines if the engine should generate the mip levels\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param samplingMode defines the required sampling mode (Texture.NEAREST_SAMPLINGMODE by default)\r\n * @param compression defines the compression used (null by default)\r\n * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\r\n * @returns the raw texture inside an InternalTexture\r\n */\r\n createRawTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n format: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean,\r\n samplingMode: number,\r\n compression: Nullable<string>,\r\n type: number,\r\n creationFlags?: number,\r\n useSRGBBuffer?: boolean\r\n ): InternalTexture;\r\n\r\n /**\r\n * Update a raw texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store in the texture\r\n * @param format defines the format of the data\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n */\r\n updateRawTexture(texture: Nullable<InternalTexture>, data: Nullable<ArrayBufferView>, format: number, invertY: boolean): void;\r\n\r\n /**\r\n * Update a raw texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store in the texture\r\n * @param format defines the format of the data\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param compression defines the compression used (null by default)\r\n * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)\r\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\r\n */\r\n updateRawTexture(\r\n texture: Nullable<InternalTexture>,\r\n data: Nullable<ArrayBufferView>,\r\n format: number,\r\n invertY: boolean,\r\n compression: Nullable<string>,\r\n type: number,\r\n useSRGBBuffer: boolean\r\n ): void;\r\n\r\n /**\r\n * Creates a new raw cube texture\r\n * @param data defines the array of data to use to create each face\r\n * @param size defines the size of the textures\r\n * @param format defines the format of the data\r\n * @param type defines the type of the data (like Engine.TEXTURETYPE_UNSIGNED_INT)\r\n * @param generateMipMaps defines if the engine should generate the mip levels\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)\r\n * @param compression defines the compression used (null by default)\r\n * @returns the cube texture as an InternalTexture\r\n */\r\n createRawCubeTexture(\r\n data: Nullable<ArrayBufferView[]>,\r\n size: number,\r\n format: number,\r\n type: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean,\r\n samplingMode: number,\r\n compression: Nullable<string>\r\n ): InternalTexture;\r\n\r\n /**\r\n * Update a raw cube texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n */\r\n updateRawCubeTexture(texture: InternalTexture, data: ArrayBufferView[], format: number, type: number, invertY: boolean): void;\r\n\r\n /**\r\n * Update a raw cube texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param compression defines the compression used (null by default)\r\n */\r\n updateRawCubeTexture(texture: InternalTexture, data: ArrayBufferView[], format: number, type: number, invertY: boolean, compression: Nullable<string>): void;\r\n\r\n /**\r\n * Update a raw cube texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param compression defines the compression used (null by default)\r\n * @param level defines which level of the texture to update\r\n */\r\n updateRawCubeTexture(texture: InternalTexture, data: ArrayBufferView[], format: number, type: number, invertY: boolean, compression: Nullable<string>, level: number): void;\r\n\r\n /**\r\n * Creates a new raw cube texture from a specified url\r\n * @param url defines the url where the data is located\r\n * @param scene defines the current scene\r\n * @param size defines the size of the textures\r\n * @param format defines the format of the data\r\n * @param type defines the type fo the data (like Engine.TEXTURETYPE_UNSIGNED_INT)\r\n * @param noMipmap defines if the engine should avoid generating the mip levels\r\n * @param callback defines a callback used to extract texture data from loaded data\r\n * @param mipmapGenerator defines to provide an optional tool to generate mip levels\r\n * @param onLoad defines a callback called when texture is loaded\r\n * @param onError defines a callback called if there is an error\r\n * @returns the cube texture as an InternalTexture\r\n */\r\n createRawCubeTextureFromUrl(\r\n url: string,\r\n scene: Nullable<Scene>,\r\n size: number,\r\n format: number,\r\n type: number,\r\n noMipmap: boolean,\r\n callback: (ArrayBuffer: ArrayBuffer) => Nullable<ArrayBufferView[]>,\r\n mipmapGenerator: Nullable<(faces: ArrayBufferView[]) => ArrayBufferView[][]>,\r\n onLoad: Nullable<() => void>,\r\n onError: Nullable<(message?: string, exception?: any) => void>\r\n ): InternalTexture;\r\n\r\n /**\r\n * Creates a new raw cube texture from a specified url\r\n * @param url defines the url where the data is located\r\n * @param scene defines the current scene\r\n * @param size defines the size of the textures\r\n * @param format defines the format of the data\r\n * @param type defines the type fo the data (like Engine.TEXTURETYPE_UNSIGNED_INT)\r\n * @param noMipmap defines if the engine should avoid generating the mip levels\r\n * @param callback defines a callback used to extract texture data from loaded data\r\n * @param mipmapGenerator defines to provide an optional tool to generate mip levels\r\n * @param onLoad defines a callback called when texture is loaded\r\n * @param onError defines a callback called if there is an error\r\n * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @returns the cube texture as an InternalTexture\r\n */\r\n createRawCubeTextureFromUrl(\r\n url: string,\r\n scene: Nullable<Scene>,\r\n size: number,\r\n format: number,\r\n type: number,\r\n noMipmap: boolean,\r\n callback: (ArrayBuffer: ArrayBuffer) => Nullable<ArrayBufferView[]>,\r\n mipmapGenerator: Nullable<(faces: ArrayBufferView[]) => ArrayBufferView[][]>,\r\n onLoad: Nullable<() => void>,\r\n onError: Nullable<(message?: string, exception?: any) => void>,\r\n samplingMode: number,\r\n invertY: boolean\r\n ): InternalTexture;\r\n\r\n /**\r\n * Creates a new raw 3D texture\r\n * @param data defines the data used to create the texture\r\n * @param width defines the width of the texture\r\n * @param height defines the height of the texture\r\n * @param depth defines the depth of the texture\r\n * @param format defines the format of the texture\r\n * @param generateMipMaps defines if the engine must generate mip levels\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)\r\n * @param compression defines the compressed used (can be null)\r\n * @param textureType defines the compressed used (can be null)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @returns a new raw 3D texture (stored in an InternalTexture)\r\n */\r\n createRawTexture3D(\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 samplingMode: number,\r\n compression: Nullable<string>,\r\n textureType: number,\r\n creationFlags?: number\r\n ): InternalTexture;\r\n\r\n /**\r\n * Update a raw 3D texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n */\r\n updateRawTexture3D(texture: InternalTexture, data: Nullable<ArrayBufferView>, format: number, invertY: boolean): void;\r\n\r\n /**\r\n * Update a raw 3D texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param compression defines the used compression (can be null)\r\n * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_INT, Engine.TEXTURETYPE_FLOAT...)\r\n */\r\n updateRawTexture3D(texture: InternalTexture, data: Nullable<ArrayBufferView>, format: number, invertY: boolean, compression: Nullable<string>, textureType: number): void;\r\n\r\n /**\r\n * Creates a new raw 2D array texture\r\n * @param data defines the data used to create the texture\r\n * @param width defines the width of the texture\r\n * @param height defines the height of the texture\r\n * @param depth defines the number of layers of the texture\r\n * @param format defines the format of the texture\r\n * @param generateMipMaps defines if the engine must generate mip levels\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)\r\n * @param compression defines the compressed used (can be null)\r\n * @param textureType defines the compressed used (can be null)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @returns a new raw 2D array texture (stored in an InternalTexture)\r\n */\r\n createRawTexture2DArray(\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 samplingMode: number,\r\n compression: Nullable<string>,\r\n textureType: number,\r\n creationFlags?: number\r\n ): InternalTexture;\r\n\r\n /**\r\n * Update a raw 2D array texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n */\r\n updateRawTexture2DArray(texture: InternalTexture, data: Nullable<ArrayBufferView>, format: number, invertY: boolean): void;\r\n\r\n /**\r\n * Update a raw 2D array texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param compression defines the used compression (can be null)\r\n * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_INT, Engine.TEXTURETYPE_FLOAT...)\r\n */\r\n updateRawTexture2DArray(\r\n texture: InternalTexture,\r\n data: Nullable<ArrayBufferView>,\r\n format: number,\r\n invertY: boolean,\r\n compression: Nullable<string>,\r\n textureType: number\r\n ): void;\r\n }\r\n}\r\n\r\nThinEngine.prototype.updateRawTexture = function (\r\n texture: Nullable<InternalTexture>,\r\n data: Nullable<ArrayBufferView>,\r\n format: number,\r\n invertY: boolean,\r\n compression: Nullable<string> = null,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n useSRGBBuffer: boolean = false\r\n): void {\r\n if (!texture) {\r\n return;\r\n }\r\n // Babylon's internalSizedFomat but gl's texImage2D internalFormat\r\n const internalSizedFomat = this._getRGBABufferInternalSizedFormat(type, format, useSRGBBuffer);\r\n\r\n // Babylon's internalFormat but gl's texImage2D format\r\n const internalFormat = this._getInternalFormat(format);\r\n const textureType = this._getWebGLTextureType(type);\r\n this._bindTextureDirectly(this._gl.TEXTURE_2D, texture, true);\r\n this._unpackFlipY(invertY === undefined ? true : invertY ? true : false);\r\n\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferView = data;\r\n texture.format = format;\r\n texture.type = type;\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n }\r\n\r\n if (texture.width % 4 !== 0) {\r\n this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT, 1);\r\n }\r\n\r\n if (compression && data) {\r\n this._gl.compressedTexImage2D(this._gl.TEXTURE_2D, 0, (<any>this.getCaps().s3tc)[compression], texture.width, texture.height, 0, <DataView>data);\r\n } else {\r\n this._gl.texImage2D(this._gl.TEXTURE_2D, 0, internalSizedFomat, texture.width, texture.height, 0, internalFormat, textureType, data);\r\n }\r\n\r\n if (texture.generateMipMaps) {\r\n this._gl.generateMipmap(this._gl.TEXTURE_2D);\r\n }\r\n this._bindTextureDirectly(this._gl.TEXTURE_2D, null);\r\n // this.resetTextureCache();\r\n texture.isReady = true;\r\n};\r\n\r\nThinEngine.prototype.createRawTexture = function (\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n format: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean,\r\n samplingMode: number,\r\n compression: Nullable<string> = null,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n creationFlags = 0,\r\n useSRGBBuffer = false\r\n): InternalTexture {\r\n const texture = new InternalTexture(this, InternalTextureSource.Raw);\r\n texture.baseWidth = width;\r\n texture.baseHeight = height;\r\n texture.width = width;\r\n texture.height = height;\r\n texture.format = format;\r\n texture.generateMipMaps = generateMipMaps;\r\n texture.samplingMode = samplingMode;\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n texture.type = type;\r\n texture._useSRGBBuffer = this._getUseSRGBBuffer(useSRGBBuffer, !generateMipMaps);\r\n\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferView = data;\r\n }\r\n\r\n this.updateRawTexture(texture, data, format, invertY, compression, type, texture._useSRGBBuffer);\r\n this._bindTextureDirectly(this._gl.TEXTURE_2D, texture, true);\r\n\r\n // Filters\r\n const filters = this._getSamplingParameters(samplingMode, generateMipMaps);\r\n\r\n this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, filters.mag);\r\n this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, filters.min);\r\n\r\n if (generateMipMaps) {\r\n this._gl.generateMipmap(this._gl.TEXTURE_2D);\r\n }\r\n\r\n this._bindTextureDirectly(this._gl.TEXTURE_2D, null);\r\n\r\n this._internalTexturesCache.push(texture);\r\n\r\n return texture;\r\n};\r\n\r\nThinEngine.prototype.createRawCubeTexture = function (\r\n data: Nullable<ArrayBufferView[]>,\r\n size: number,\r\n format: number,\r\n type: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean,\r\n samplingMode: number,\r\n compression: Nullable<string> = null\r\n): InternalTexture {\r\n const gl = this._gl;\r\n const texture = new InternalTexture(this, InternalTextureSource.CubeRaw);\r\n texture.isCube = true;\r\n texture.format = format;\r\n texture.type = type;\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferViewArray = data;\r\n }\r\n\r\n const textureType = this._getWebGLTextureType(type);\r\n let internalFormat = this._getInternalFormat(format);\r\n\r\n if (internalFormat === gl.RGB) {\r\n internalFormat = gl.RGBA;\r\n }\r\n\r\n // Mipmap generation needs a sized internal format that is both color-renderable and texture-filterable\r\n if (textureType === gl.FLOAT && !this._caps.textureFloatLinearFiltering) {\r\n generateMipMaps = false;\r\n samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n Logger.Warn(\"Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.\");\r\n } else if (textureType === this._gl.HALF_FLOAT_OES && !this._caps.textureHalfFloatLinearFiltering) {\r\n generateMipMaps = false;\r\n samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n Logger.Warn(\"Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.\");\r\n } else if (textureType === gl.FLOAT && !this._caps.textureFloatRender) {\r\n generateMipMaps = false;\r\n Logger.Warn(\"Render to float textures is not supported. Mipmap generation forced to false.\");\r\n } else if (textureType === gl.HALF_FLOAT && !this._caps.colorBufferFloat) {\r\n generateMipMaps = false;\r\n Logger.Warn(\"Render to half float textures is not supported. Mipmap generation forced to false.\");\r\n }\r\n\r\n const width = size;\r\n const height = width;\r\n\r\n texture.width = width;\r\n texture.height = height;\r\n\r\n // Double check on POT to generate Mips.\r\n const isPot = !this.needPOTTextures || (Tools.IsExponentOfTwo(texture.width) && Tools.IsExponentOfTwo(texture.height));\r\n if (!isPot) {\r\n generateMipMaps = false;\r\n }\r\n\r\n // Upload data if needed. The texture won't be ready until then.\r\n if (data) {\r\n this.updateRawCubeTexture(texture, data, format, type, invertY, compression);\r\n }\r\n\r\n this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, texture, true);\r\n\r\n // Filters\r\n if (data && generateMipMaps) {\r\n this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP);\r\n }\r\n\r\n const filters = this._getSamplingParameters(samplingMode, generateMipMaps);\r\n gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, filters.mag);\r\n gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, filters.min);\r\n\r\n gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\r\n gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\r\n this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null);\r\n\r\n texture.generateMipMaps = generateMipMaps;\r\n texture.samplingMode = samplingMode;\r\n\r\n return texture;\r\n};\r\n\r\nThinEngine.prototype.updateRawCubeTexture = function (\r\n texture: InternalTexture,\r\n data: ArrayBufferView[],\r\n format: number,\r\n type: number,\r\n invertY: boolean,\r\n compression: Nullable<string> = null,\r\n level: number = 0\r\n): void {\r\n texture._bufferViewArray = data;\r\n texture.format = format;\r\n texture.type = type;\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n\r\n const gl = this._gl;\r\n const textureType = this._getWebGLTextureType(type);\r\n let internalFormat = this._getInternalFormat(format);\r\n const internalSizedFomat = this._getRGBABufferInternalSizedFormat(type);\r\n\r\n let needConversion = false;\r\n if (internalFormat === gl.RGB) {\r\n internalFormat = gl.RGBA;\r\n needConversion = true;\r\n }\r\n\r\n this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture, true);\r\n this._unpackFlipY(invertY === undefined ? true : invertY ? true : false);\r\n\r\n if (texture.width % 4 !== 0) {\r\n gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1);\r\n }\r\n\r\n // Data are known to be in +X +Y +Z -X -Y -Z\r\n for (let faceIndex = 0; faceIndex < 6; faceIndex++) {\r\n let faceData = data[faceIndex];\r\n\r\n if (compression) {\r\n gl.compressedTexImage2D(\r\n gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex,\r\n level,\r\n (<any>this.getCaps().s3tc)[compression],\r\n texture.width,\r\n texture.height,\r\n 0,\r\n <DataView>faceData\r\n );\r\n } else {\r\n if (needConversion) {\r\n faceData = _convertRGBtoRGBATextureData(faceData, texture.width, texture.height, type);\r\n }\r\n gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, level, internalSizedFomat, texture.width, texture.height, 0, internalFormat, textureType, faceData);\r\n }\r\n }\r\n\r\n const isPot = !this.needPOTTextures || (Tools.IsExponentOfTwo(texture.width) && Tools.IsExponentOfTwo(texture.height));\r\n if (isPot && texture.generateMipMaps && level === 0) {\r\n this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP);\r\n }\r\n this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null);\r\n\r\n // this.resetTextureCache();\r\n texture.isReady = true;\r\n};\r\n\r\nThinEngine.prototype.createRawCubeTextureFromUrl = function (\r\n url: string,\r\n scene: Nullable<Scene>,\r\n size: number,\r\n format: number,\r\n type: number,\r\n noMipmap: boolean,\r\n callback: (ArrayBuffer: ArrayBuffer) => Nullable<ArrayBufferView[]>,\r\n mipmapGenerator: Nullable<(faces: ArrayBufferView[]) => ArrayBufferView[][]>,\r\n onLoad: Nullable<() => void> = null,\r\n onError: Nullable<(message?: string, exception?: any) => void> = null,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n invertY: boolean = false\r\n): InternalTexture {\r\n const gl = this._gl;\r\n const texture = this.createRawCubeTexture(null, size, format, type, !noMipmap, invertY, samplingMode, null);\r\n scene?._addPendingData(texture);\r\n texture.url = url;\r\n this._internalTexturesCache.push(texture);\r\n\r\n const onerror = (request?: IWebRequest, exception?: any) => {\r\n scene?._removePendingData(texture);\r\n if (onError && request) {\r\n onError(request.status + \" \" + request.statusText, exception);\r\n }\r\n };\r\n\r\n const internalCallback = (data: any) => {\r\n const width = texture.width;\r\n const faceDataArrays = callback(data);\r\n\r\n if (!faceDataArrays) {\r\n return;\r\n }\r\n\r\n if (mipmapGenerator) {\r\n const textureType = this._getWebGLTextureType(type);\r\n let internalFormat = this._getInternalFormat(format);\r\n const internalSizedFomat = this._getRGBABufferInternalSizedFormat(type);\r\n\r\n let needConversion = false;\r\n if (internalFormat === gl.RGB) {\r\n internalFormat = gl.RGBA;\r\n needConversion = true;\r\n }\r\n\r\n this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture, true);\r\n this._unpackFlipY(false);\r\n\r\n const mipData = mipmapGenerator(faceDataArrays);\r\n for (let level = 0; level < mipData.length; level++) {\r\n const mipSize = width >> level;\r\n\r\n for (let faceIndex = 0; faceIndex < 6; faceIndex++) {\r\n let mipFaceData = mipData[level][faceIndex];\r\n if (needConversion) {\r\n mipFaceData = _convertRGBtoRGBATextureData(mipFaceData, mipSize, mipSize, type);\r\n }\r\n gl.texImage2D(faceIndex, level, internalSizedFomat, mipSize, mipSize, 0, internalFormat, textureType, mipFaceData);\r\n }\r\n }\r\n\r\n this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null);\r\n } else {\r\n this.updateRawCubeTexture(texture, faceDataArrays, format, type, invertY);\r\n }\r\n\r\n texture.isReady = true;\r\n // this.resetTextureCache();\r\n scene?._removePendingData(texture);\r\n\r\n if (onLoad) {\r\n onLoad();\r\n }\r\n };\r\n\r\n this._loadFile(\r\n url,\r\n (data) => {\r\n internalCallback(data);\r\n },\r\n undefined,\r\n scene?.offlineProvider,\r\n true,\r\n onerror\r\n );\r\n\r\n return texture;\r\n};\r\n\r\n/**\r\n * @param rgbData\r\n * @param width\r\n * @param height\r\n * @param textureType\r\n * @hidden\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nfunction _convertRGBtoRGBATextureData(rgbData: any, width: number, height: number, textureType: number): ArrayBufferView {\r\n // Create new RGBA data container.\r\n let rgbaData: any;\r\n let val1 = 1;\r\n if (textureType === Constants.TEXTURETYPE_FLOAT) {\r\n rgbaData = new Float32Array(width * height * 4);\r\n } else if (textureType === Constants.TEXTURETYPE_HALF_FLOAT) {\r\n rgbaData = new Uint16Array(width * height * 4);\r\n val1 = 15360; // 15360 is the encoding of 1 in half float\r\n } else if (textureType === Constants.TEXTURETYPE_UNSIGNED_INTEGER) {\r\n rgbaData = new Uint32Array(width * height * 4);\r\n } else {\r\n rgbaData = new Uint8Array(width * height * 4);\r\n }\r\n\r\n // Convert each pixel.\r\n for (let x = 0; x < width; x++) {\r\n for (let y = 0; y < height; y++) {\r\n const index = (y * width + x) * 3;\r\n const newIndex = (y * width + x) * 4;\r\n\r\n // Map Old Value to new value.\r\n rgbaData[newIndex + 0] = rgbData[index + 0];\r\n rgbaData[newIndex + 1] = rgbData[index + 1];\r\n rgbaData[newIndex + 2] = rgbData[index + 2];\r\n\r\n // Add fully opaque alpha channel.\r\n rgbaData[newIndex + 3] = val1;\r\n }\r\n }\r\n\r\n return rgbaData;\r\n}\r\n\r\n/**\r\n * Create a function for createRawTexture3D/createRawTexture2DArray\r\n * @param is3D true for TEXTURE_3D and false for TEXTURE_2D_ARRAY\r\n * @hidden\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nfunction _makeCreateRawTextureFunction(is3D: boolean) {\r\n return function (\r\n this: ThinEngine,\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 samplingMode: number,\r\n compression: Nullable<string> = null,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_INT\r\n ): InternalTexture {\r\n const target = is3D ? this._gl.TEXTURE_3D : this._gl.TEXTURE_2D_ARRAY;\r\n const source = is3D ? InternalTextureSource.Raw3D : InternalTextureSource.Raw2DArray;\r\n const texture = new InternalTexture(this, source);\r\n texture.baseWidth = width;\r\n texture.baseHeight = height;\r\n texture.baseDepth = depth;\r\n texture.width = width;\r\n texture.height = height;\r\n texture.depth = depth;\r\n texture.format = format;\r\n texture.type = textureType;\r\n texture.generateMipMaps = generateMipMaps;\r\n texture.samplingMode = samplingMode;\r\n if (is3D) {\r\n texture.is3D = true;\r\n } else {\r\n texture.is2DArray = true;\r\n }\r\n\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferView = data;\r\n }\r\n\r\n if (is3D) {\r\n this.updateRawTexture3D(texture, data, format, invertY, compression, textureType);\r\n } else {\r\n this.updateRawTexture2DArray(texture, data, format, invertY, compression, textureType);\r\n }\r\n this._bindTextureDirectly(target, texture, true);\r\n\r\n // Filters\r\n const filters = this._getSamplingParameters(samplingMode, generateMipMaps);\r\n\r\n this._gl.texParameteri(target, this._gl.TEXTURE_MAG_FILTER, filters.mag);\r\n this._gl.texParameteri(target, this._gl.TEXTURE_MIN_FILTER, filters.min);\r\n\r\n if (generateMipMaps) {\r\n this._gl.generateMipmap(target);\r\n }\r\n\r\n this._bindTextureDirectly(target, null);\r\n\r\n this._internalTexturesCache.push(texture);\r\n\r\n return texture;\r\n };\r\n}\r\n\r\nThinEngine.prototype.createRawTexture2DArray = _makeCreateRawTextureFunction(false);\r\nThinEngine.prototype.createRawTexture3D = _makeCreateRawTextureFunction(true);\r\n\r\n/**\r\n * Create a function for updateRawTexture3D/updateRawTexture2DArray\r\n * @param is3D true for TEXTURE_3D and false for TEXTURE_2D_ARRAY\r\n * @hidden\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nfunction _makeUpdateRawTextureFunction(is3D: boolean) {\r\n return function (\r\n this: ThinEngine,\r\n texture: InternalTexture,\r\n data: Nullable<ArrayBufferView>,\r\n format: number,\r\n invertY: boolean,\r\n compression: Nullable<string> = null,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_INT\r\n ): void {\r\n const target = is3D ? this._gl.TEXTURE_3D : this._gl.TEXTURE_2D_ARRAY;\r\n const internalType = this._getWebGLTextureType(textureType);\r\n const internalFormat = this._getInternalFormat(format);\r\n const internalSizedFomat = this._getRGBABufferInternalSizedFormat(textureType, format);\r\n\r\n this._bindTextureDirectly(target, texture, true);\r\n this._unpackFlipY(invertY === undefined ? true : invertY ? true : false);\r\n\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferView = data;\r\n texture.format = format;\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n }\r\n\r\n if (texture.width % 4 !== 0) {\r\n this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT, 1);\r\n }\r\n\r\n if (compression && data) {\r\n this._gl.compressedTexImage3D(target, 0, (<any>this.getCaps().s3tc)[compression], texture.width, texture.height, texture.depth, 0, data);\r\n } else {\r\n this._gl.texImage3D(target, 0, internalSizedFomat, texture.width, texture.height, texture.depth, 0, internalFormat, internalType, data);\r\n }\r\n\r\n if (texture.generateMipMaps) {\r\n this._gl.generateMipmap(target);\r\n }\r\n this._bindTextureDirectly(target, null);\r\n // this.resetTextureCache();\r\n texture.isReady = true;\r\n };\r\n}\r\n\r\nThinEngine.prototype.updateRawTexture2DArray = _makeUpdateRawTextureFunction(false);\r\nThinEngine.prototype.updateRawTexture3D = _makeUpdateRawTextureFunction(true);\r\n"]}
1
+ {"version":3,"file":"engine.rawTexture.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/Engines/Extensions/engine.rawTexture.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAClG,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AA4R3C,UAAU,CAAC,SAAS,CAAC,gBAAgB,GAAG,UACpC,OAAkC,EAClC,IAA+B,EAC/B,MAAc,EACd,OAAgB,EAChB,WAAoC,EACpC,IAAiD,EACjD,aAA8B;IAF9B,4BAAA,EAAA,kBAAoC;IACpC,qBAAA,EAAA,OAAe,SAAS,CAAC,wBAAwB;IACjD,8BAAA,EAAA,qBAA8B;IAE9B,IAAI,CAAC,OAAO,EAAE;QACV,OAAO;KACV;IACD,kEAAkE;IAClE,IAAM,kBAAkB,GAAG,IAAI,CAAC,iCAAiC,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC;IAE/F,sDAAsD;IACtD,IAAM,cAAc,GAAG,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;IACvD,IAAM,WAAW,GAAG,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;IACpD,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IAC9D,IAAI,CAAC,YAAY,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAEzE,IAAI,CAAC,IAAI,CAAC,uBAA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,EAAE,CAAC,EAAE,kBAAkB,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,EAAE,cAAc,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;SAC3I;QAED,IAAI,OAAO,CAAC,eAAe,EAAE;YACzB,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;SACnC;QACD,IAAI,CAAC,oBAAoB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACxC,4BAA4B;QAC5B,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAC3B,CAAC,CAAC;AACN,CAAC;AAED,UAAU,CAAC,SAAS,CAAC,uBAAuB,GAAG,6BAA6B,CAAC,KAAK,CAAC,CAAC;AACpF,UAAU,CAAC,SAAS,CAAC,kBAAkB,GAAG,6BAA6B,CAAC,IAAI,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"../../types\";\r\nimport { InternalTexture, InternalTextureSource } from \"../../Materials/Textures/internalTexture\";\r\nimport { Logger } from \"../../Misc/logger\";\r\nimport { Tools } from \"../../Misc/tools\";\r\nimport type { Scene } from \"../../scene\";\r\nimport { Constants } from \"../constants\";\r\nimport { ThinEngine } from \"../thinEngine\";\r\nimport type { IWebRequest } from \"../../Misc/interfaces/iWebRequest\";\r\n\r\ndeclare module \"../../Engines/thinEngine\" {\r\n export interface ThinEngine {\r\n /**\r\n * Creates a raw texture\r\n * @param data defines the data to store in the texture\r\n * @param width defines the width of the texture\r\n * @param height defines the height of the texture\r\n * @param format defines the format of the data\r\n * @param generateMipMaps defines if the engine should generate the mip levels\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param samplingMode defines the required sampling mode (Texture.NEAREST_SAMPLINGMODE by default)\r\n * @param compression defines the compression used (null by default)\r\n * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\r\n * @returns the raw texture inside an InternalTexture\r\n */\r\n createRawTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n format: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean,\r\n samplingMode: number,\r\n compression: Nullable<string>,\r\n type: number,\r\n creationFlags?: number,\r\n useSRGBBuffer?: boolean\r\n ): InternalTexture;\r\n\r\n /**\r\n * Update a raw texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store in the texture\r\n * @param format defines the format of the data\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n */\r\n updateRawTexture(texture: Nullable<InternalTexture>, data: Nullable<ArrayBufferView>, format: number, invertY: boolean): void;\r\n\r\n /**\r\n * Update a raw texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store in the texture\r\n * @param format defines the format of the data\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param compression defines the compression used (null by default)\r\n * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)\r\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\r\n */\r\n updateRawTexture(\r\n texture: Nullable<InternalTexture>,\r\n data: Nullable<ArrayBufferView>,\r\n format: number,\r\n invertY: boolean,\r\n compression: Nullable<string>,\r\n type: number,\r\n useSRGBBuffer: boolean\r\n ): void;\r\n\r\n /**\r\n * Creates a new raw cube texture\r\n * @param data defines the array of data to use to create each face\r\n * @param size defines the size of the textures\r\n * @param format defines the format of the data\r\n * @param type defines the type of the data (like Engine.TEXTURETYPE_UNSIGNED_INT)\r\n * @param generateMipMaps defines if the engine should generate the mip levels\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)\r\n * @param compression defines the compression used (null by default)\r\n * @returns the cube texture as an InternalTexture\r\n */\r\n createRawCubeTexture(\r\n data: Nullable<ArrayBufferView[]>,\r\n size: number,\r\n format: number,\r\n type: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean,\r\n samplingMode: number,\r\n compression: Nullable<string>\r\n ): InternalTexture;\r\n\r\n /**\r\n * Update a raw cube texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n */\r\n updateRawCubeTexture(texture: InternalTexture, data: ArrayBufferView[], format: number, type: number, invertY: boolean): void;\r\n\r\n /**\r\n * Update a raw cube texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param compression defines the compression used (null by default)\r\n */\r\n updateRawCubeTexture(texture: InternalTexture, data: ArrayBufferView[], format: number, type: number, invertY: boolean, compression: Nullable<string>): void;\r\n\r\n /**\r\n * Update a raw cube texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param compression defines the compression used (null by default)\r\n * @param level defines which level of the texture to update\r\n */\r\n updateRawCubeTexture(texture: InternalTexture, data: ArrayBufferView[], format: number, type: number, invertY: boolean, compression: Nullable<string>, level: number): void;\r\n\r\n /**\r\n * Creates a new raw cube texture from a specified url\r\n * @param url defines the url where the data is located\r\n * @param scene defines the current scene\r\n * @param size defines the size of the textures\r\n * @param format defines the format of the data\r\n * @param type defines the type fo the data (like Engine.TEXTURETYPE_UNSIGNED_INT)\r\n * @param noMipmap defines if the engine should avoid generating the mip levels\r\n * @param callback defines a callback used to extract texture data from loaded data\r\n * @param mipmapGenerator defines to provide an optional tool to generate mip levels\r\n * @param onLoad defines a callback called when texture is loaded\r\n * @param onError defines a callback called if there is an error\r\n * @returns the cube texture as an InternalTexture\r\n */\r\n createRawCubeTextureFromUrl(\r\n url: string,\r\n scene: Nullable<Scene>,\r\n size: number,\r\n format: number,\r\n type: number,\r\n noMipmap: boolean,\r\n callback: (ArrayBuffer: ArrayBuffer) => Nullable<ArrayBufferView[]>,\r\n mipmapGenerator: Nullable<(faces: ArrayBufferView[]) => ArrayBufferView[][]>,\r\n onLoad: Nullable<() => void>,\r\n onError: Nullable<(message?: string, exception?: any) => void>\r\n ): InternalTexture;\r\n\r\n /**\r\n * Creates a new raw cube texture from a specified url\r\n * @param url defines the url where the data is located\r\n * @param scene defines the current scene\r\n * @param size defines the size of the textures\r\n * @param format defines the format of the data\r\n * @param type defines the type fo the data (like Engine.TEXTURETYPE_UNSIGNED_INT)\r\n * @param noMipmap defines if the engine should avoid generating the mip levels\r\n * @param callback defines a callback used to extract texture data from loaded data\r\n * @param mipmapGenerator defines to provide an optional tool to generate mip levels\r\n * @param onLoad defines a callback called when texture is loaded\r\n * @param onError defines a callback called if there is an error\r\n * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @returns the cube texture as an InternalTexture\r\n */\r\n createRawCubeTextureFromUrl(\r\n url: string,\r\n scene: Nullable<Scene>,\r\n size: number,\r\n format: number,\r\n type: number,\r\n noMipmap: boolean,\r\n callback: (ArrayBuffer: ArrayBuffer) => Nullable<ArrayBufferView[]>,\r\n mipmapGenerator: Nullable<(faces: ArrayBufferView[]) => ArrayBufferView[][]>,\r\n onLoad: Nullable<() => void>,\r\n onError: Nullable<(message?: string, exception?: any) => void>,\r\n samplingMode: number,\r\n invertY: boolean\r\n ): InternalTexture;\r\n\r\n /**\r\n * Creates a new raw 3D texture\r\n * @param data defines the data used to create the texture\r\n * @param width defines the width of the texture\r\n * @param height defines the height of the texture\r\n * @param depth defines the depth of the texture\r\n * @param format defines the format of the texture\r\n * @param generateMipMaps defines if the engine must generate mip levels\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)\r\n * @param compression defines the compressed used (can be null)\r\n * @param textureType defines the compressed used (can be null)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @returns a new raw 3D texture (stored in an InternalTexture)\r\n */\r\n createRawTexture3D(\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 samplingMode: number,\r\n compression: Nullable<string>,\r\n textureType: number,\r\n creationFlags?: number\r\n ): InternalTexture;\r\n\r\n /**\r\n * Update a raw 3D texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n */\r\n updateRawTexture3D(texture: InternalTexture, data: Nullable<ArrayBufferView>, format: number, invertY: boolean): void;\r\n\r\n /**\r\n * Update a raw 3D texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param compression defines the used compression (can be null)\r\n * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_INT, Engine.TEXTURETYPE_FLOAT...)\r\n */\r\n updateRawTexture3D(texture: InternalTexture, data: Nullable<ArrayBufferView>, format: number, invertY: boolean, compression: Nullable<string>, textureType: number): void;\r\n\r\n /**\r\n * Creates a new raw 2D array texture\r\n * @param data defines the data used to create the texture\r\n * @param width defines the width of the texture\r\n * @param height defines the height of the texture\r\n * @param depth defines the number of layers of the texture\r\n * @param format defines the format of the texture\r\n * @param generateMipMaps defines if the engine must generate mip levels\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)\r\n * @param compression defines the compressed used (can be null)\r\n * @param textureType defines the compressed used (can be null)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @returns a new raw 2D array texture (stored in an InternalTexture)\r\n */\r\n createRawTexture2DArray(\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 samplingMode: number,\r\n compression: Nullable<string>,\r\n textureType: number,\r\n creationFlags?: number\r\n ): InternalTexture;\r\n\r\n /**\r\n * Update a raw 2D array texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n */\r\n updateRawTexture2DArray(texture: InternalTexture, data: Nullable<ArrayBufferView>, format: number, invertY: boolean): void;\r\n\r\n /**\r\n * Update a raw 2D array texture\r\n * @param texture defines the texture to update\r\n * @param data defines the data to store\r\n * @param format defines the data format\r\n * @param invertY defines if data must be stored with Y axis inverted\r\n * @param compression defines the used compression (can be null)\r\n * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_INT, Engine.TEXTURETYPE_FLOAT...)\r\n */\r\n updateRawTexture2DArray(\r\n texture: InternalTexture,\r\n data: Nullable<ArrayBufferView>,\r\n format: number,\r\n invertY: boolean,\r\n compression: Nullable<string>,\r\n textureType: number\r\n ): void;\r\n }\r\n}\r\n\r\nThinEngine.prototype.updateRawTexture = function (\r\n texture: Nullable<InternalTexture>,\r\n data: Nullable<ArrayBufferView>,\r\n format: number,\r\n invertY: boolean,\r\n compression: Nullable<string> = null,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n useSRGBBuffer: boolean = false\r\n): void {\r\n if (!texture) {\r\n return;\r\n }\r\n // Babylon's internalSizedFomat but gl's texImage2D internalFormat\r\n const internalSizedFomat = this._getRGBABufferInternalSizedFormat(type, format, useSRGBBuffer);\r\n\r\n // Babylon's internalFormat but gl's texImage2D format\r\n const internalFormat = this._getInternalFormat(format);\r\n const textureType = this._getWebGLTextureType(type);\r\n this._bindTextureDirectly(this._gl.TEXTURE_2D, texture, true);\r\n this._unpackFlipY(invertY === undefined ? true : invertY ? true : false);\r\n\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferView = data;\r\n texture.format = format;\r\n texture.type = type;\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n }\r\n\r\n if (texture.width % 4 !== 0) {\r\n this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT, 1);\r\n }\r\n\r\n if (compression && data) {\r\n this._gl.compressedTexImage2D(this._gl.TEXTURE_2D, 0, (<any>this.getCaps().s3tc)[compression], texture.width, texture.height, 0, <DataView>data);\r\n } else {\r\n this._gl.texImage2D(this._gl.TEXTURE_2D, 0, internalSizedFomat, texture.width, texture.height, 0, internalFormat, textureType, data);\r\n }\r\n\r\n if (texture.generateMipMaps) {\r\n this._gl.generateMipmap(this._gl.TEXTURE_2D);\r\n }\r\n this._bindTextureDirectly(this._gl.TEXTURE_2D, null);\r\n // this.resetTextureCache();\r\n texture.isReady = true;\r\n};\r\n\r\nThinEngine.prototype.createRawTexture = function (\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n format: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean,\r\n samplingMode: number,\r\n compression: Nullable<string> = null,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n creationFlags = 0,\r\n useSRGBBuffer = false\r\n): InternalTexture {\r\n const texture = new InternalTexture(this, InternalTextureSource.Raw);\r\n texture.baseWidth = width;\r\n texture.baseHeight = height;\r\n texture.width = width;\r\n texture.height = height;\r\n texture.format = format;\r\n texture.generateMipMaps = generateMipMaps;\r\n texture.samplingMode = samplingMode;\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n texture.type = type;\r\n texture._useSRGBBuffer = this._getUseSRGBBuffer(useSRGBBuffer, !generateMipMaps);\r\n\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferView = data;\r\n }\r\n\r\n this.updateRawTexture(texture, data, format, invertY, compression, type, texture._useSRGBBuffer);\r\n this._bindTextureDirectly(this._gl.TEXTURE_2D, texture, true);\r\n\r\n // Filters\r\n const filters = this._getSamplingParameters(samplingMode, generateMipMaps);\r\n\r\n this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, filters.mag);\r\n this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, filters.min);\r\n\r\n if (generateMipMaps) {\r\n this._gl.generateMipmap(this._gl.TEXTURE_2D);\r\n }\r\n\r\n this._bindTextureDirectly(this._gl.TEXTURE_2D, null);\r\n\r\n this._internalTexturesCache.push(texture);\r\n\r\n return texture;\r\n};\r\n\r\nThinEngine.prototype.createRawCubeTexture = function (\r\n data: Nullable<ArrayBufferView[]>,\r\n size: number,\r\n format: number,\r\n type: number,\r\n generateMipMaps: boolean,\r\n invertY: boolean,\r\n samplingMode: number,\r\n compression: Nullable<string> = null\r\n): InternalTexture {\r\n const gl = this._gl;\r\n const texture = new InternalTexture(this, InternalTextureSource.CubeRaw);\r\n texture.isCube = true;\r\n texture.format = format;\r\n texture.type = type;\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferViewArray = data;\r\n }\r\n\r\n const textureType = this._getWebGLTextureType(type);\r\n let internalFormat = this._getInternalFormat(format);\r\n\r\n if (internalFormat === gl.RGB) {\r\n internalFormat = gl.RGBA;\r\n }\r\n\r\n // Mipmap generation needs a sized internal format that is both color-renderable and texture-filterable\r\n if (textureType === gl.FLOAT && !this._caps.textureFloatLinearFiltering) {\r\n generateMipMaps = false;\r\n samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n Logger.Warn(\"Float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.\");\r\n } else if (textureType === this._gl.HALF_FLOAT_OES && !this._caps.textureHalfFloatLinearFiltering) {\r\n generateMipMaps = false;\r\n samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n Logger.Warn(\"Half float texture filtering is not supported. Mipmap generation and sampling mode are forced to false and TEXTURE_NEAREST_SAMPLINGMODE, respectively.\");\r\n } else if (textureType === gl.FLOAT && !this._caps.textureFloatRender) {\r\n generateMipMaps = false;\r\n Logger.Warn(\"Render to float textures is not supported. Mipmap generation forced to false.\");\r\n } else if (textureType === gl.HALF_FLOAT && !this._caps.colorBufferFloat) {\r\n generateMipMaps = false;\r\n Logger.Warn(\"Render to half float textures is not supported. Mipmap generation forced to false.\");\r\n }\r\n\r\n const width = size;\r\n const height = width;\r\n\r\n texture.width = width;\r\n texture.height = height;\r\n\r\n // Double check on POT to generate Mips.\r\n const isPot = !this.needPOTTextures || (Tools.IsExponentOfTwo(texture.width) && Tools.IsExponentOfTwo(texture.height));\r\n if (!isPot) {\r\n generateMipMaps = false;\r\n }\r\n\r\n // Upload data if needed. The texture won't be ready until then.\r\n if (data) {\r\n this.updateRawCubeTexture(texture, data, format, type, invertY, compression);\r\n }\r\n\r\n this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, texture, true);\r\n\r\n // Filters\r\n if (data && generateMipMaps) {\r\n this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP);\r\n }\r\n\r\n const filters = this._getSamplingParameters(samplingMode, generateMipMaps);\r\n gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, filters.mag);\r\n gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, filters.min);\r\n\r\n gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\r\n gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\r\n this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null);\r\n\r\n texture.generateMipMaps = generateMipMaps;\r\n texture.samplingMode = samplingMode;\r\n\r\n return texture;\r\n};\r\n\r\nThinEngine.prototype.updateRawCubeTexture = function (\r\n texture: InternalTexture,\r\n data: ArrayBufferView[],\r\n format: number,\r\n type: number,\r\n invertY: boolean,\r\n compression: Nullable<string> = null,\r\n level: number = 0\r\n): void {\r\n texture._bufferViewArray = data;\r\n texture.format = format;\r\n texture.type = type;\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n\r\n const gl = this._gl;\r\n const textureType = this._getWebGLTextureType(type);\r\n let internalFormat = this._getInternalFormat(format);\r\n const internalSizedFomat = this._getRGBABufferInternalSizedFormat(type);\r\n\r\n let needConversion = false;\r\n if (internalFormat === gl.RGB) {\r\n internalFormat = gl.RGBA;\r\n needConversion = true;\r\n }\r\n\r\n this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture, true);\r\n this._unpackFlipY(invertY === undefined ? true : invertY ? true : false);\r\n\r\n if (texture.width % 4 !== 0) {\r\n gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1);\r\n }\r\n\r\n // Data are known to be in +X +Y +Z -X -Y -Z\r\n for (let faceIndex = 0; faceIndex < 6; faceIndex++) {\r\n let faceData = data[faceIndex];\r\n\r\n if (compression) {\r\n gl.compressedTexImage2D(\r\n gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex,\r\n level,\r\n (<any>this.getCaps().s3tc)[compression],\r\n texture.width,\r\n texture.height,\r\n 0,\r\n <DataView>faceData\r\n );\r\n } else {\r\n if (needConversion) {\r\n faceData = _convertRGBtoRGBATextureData(faceData, texture.width, texture.height, type);\r\n }\r\n gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + faceIndex, level, internalSizedFomat, texture.width, texture.height, 0, internalFormat, textureType, faceData);\r\n }\r\n }\r\n\r\n const isPot = !this.needPOTTextures || (Tools.IsExponentOfTwo(texture.width) && Tools.IsExponentOfTwo(texture.height));\r\n if (isPot && texture.generateMipMaps && level === 0) {\r\n this._gl.generateMipmap(this._gl.TEXTURE_CUBE_MAP);\r\n }\r\n this._bindTextureDirectly(this._gl.TEXTURE_CUBE_MAP, null);\r\n\r\n // this.resetTextureCache();\r\n texture.isReady = true;\r\n};\r\n\r\nThinEngine.prototype.createRawCubeTextureFromUrl = function (\r\n url: string,\r\n scene: Nullable<Scene>,\r\n size: number,\r\n format: number,\r\n type: number,\r\n noMipmap: boolean,\r\n callback: (ArrayBuffer: ArrayBuffer) => Nullable<ArrayBufferView[]>,\r\n mipmapGenerator: Nullable<(faces: ArrayBufferView[]) => ArrayBufferView[][]>,\r\n onLoad: Nullable<() => void> = null,\r\n onError: Nullable<(message?: string, exception?: any) => void> = null,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n invertY: boolean = false\r\n): InternalTexture {\r\n const gl = this._gl;\r\n const texture = this.createRawCubeTexture(null, size, format, type, !noMipmap, invertY, samplingMode, null);\r\n scene?._addPendingData(texture);\r\n texture.url = url;\r\n this._internalTexturesCache.push(texture);\r\n\r\n const onerror = (request?: IWebRequest, exception?: any) => {\r\n scene?._removePendingData(texture);\r\n if (onError && request) {\r\n onError(request.status + \" \" + request.statusText, exception);\r\n }\r\n };\r\n\r\n const internalCallback = (data: any) => {\r\n const width = texture.width;\r\n const faceDataArrays = callback(data);\r\n\r\n if (!faceDataArrays) {\r\n return;\r\n }\r\n\r\n if (mipmapGenerator) {\r\n const textureType = this._getWebGLTextureType(type);\r\n let internalFormat = this._getInternalFormat(format);\r\n const internalSizedFomat = this._getRGBABufferInternalSizedFormat(type);\r\n\r\n let needConversion = false;\r\n if (internalFormat === gl.RGB) {\r\n internalFormat = gl.RGBA;\r\n needConversion = true;\r\n }\r\n\r\n this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture, true);\r\n this._unpackFlipY(false);\r\n\r\n const mipData = mipmapGenerator(faceDataArrays);\r\n for (let level = 0; level < mipData.length; level++) {\r\n const mipSize = width >> level;\r\n\r\n for (let faceIndex = 0; faceIndex < 6; faceIndex++) {\r\n let mipFaceData = mipData[level][faceIndex];\r\n if (needConversion) {\r\n mipFaceData = _convertRGBtoRGBATextureData(mipFaceData, mipSize, mipSize, type);\r\n }\r\n gl.texImage2D(faceIndex, level, internalSizedFomat, mipSize, mipSize, 0, internalFormat, textureType, mipFaceData);\r\n }\r\n }\r\n\r\n this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null);\r\n } else {\r\n this.updateRawCubeTexture(texture, faceDataArrays, format, type, invertY);\r\n }\r\n\r\n texture.isReady = true;\r\n // this.resetTextureCache();\r\n scene?._removePendingData(texture);\r\n\r\n texture.onLoadedObservable.notifyObservers(texture);\r\n texture.onLoadedObservable.clear();\r\n\r\n if (onLoad) {\r\n onLoad();\r\n }\r\n };\r\n\r\n this._loadFile(\r\n url,\r\n (data) => {\r\n internalCallback(data);\r\n },\r\n undefined,\r\n scene?.offlineProvider,\r\n true,\r\n onerror\r\n );\r\n\r\n return texture;\r\n};\r\n\r\n/**\r\n * @param rgbData\r\n * @param width\r\n * @param height\r\n * @param textureType\r\n * @hidden\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nfunction _convertRGBtoRGBATextureData(rgbData: any, width: number, height: number, textureType: number): ArrayBufferView {\r\n // Create new RGBA data container.\r\n let rgbaData: any;\r\n let val1 = 1;\r\n if (textureType === Constants.TEXTURETYPE_FLOAT) {\r\n rgbaData = new Float32Array(width * height * 4);\r\n } else if (textureType === Constants.TEXTURETYPE_HALF_FLOAT) {\r\n rgbaData = new Uint16Array(width * height * 4);\r\n val1 = 15360; // 15360 is the encoding of 1 in half float\r\n } else if (textureType === Constants.TEXTURETYPE_UNSIGNED_INTEGER) {\r\n rgbaData = new Uint32Array(width * height * 4);\r\n } else {\r\n rgbaData = new Uint8Array(width * height * 4);\r\n }\r\n\r\n // Convert each pixel.\r\n for (let x = 0; x < width; x++) {\r\n for (let y = 0; y < height; y++) {\r\n const index = (y * width + x) * 3;\r\n const newIndex = (y * width + x) * 4;\r\n\r\n // Map Old Value to new value.\r\n rgbaData[newIndex + 0] = rgbData[index + 0];\r\n rgbaData[newIndex + 1] = rgbData[index + 1];\r\n rgbaData[newIndex + 2] = rgbData[index + 2];\r\n\r\n // Add fully opaque alpha channel.\r\n rgbaData[newIndex + 3] = val1;\r\n }\r\n }\r\n\r\n return rgbaData;\r\n}\r\n\r\n/**\r\n * Create a function for createRawTexture3D/createRawTexture2DArray\r\n * @param is3D true for TEXTURE_3D and false for TEXTURE_2D_ARRAY\r\n * @hidden\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nfunction _makeCreateRawTextureFunction(is3D: boolean) {\r\n return function (\r\n this: ThinEngine,\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 samplingMode: number,\r\n compression: Nullable<string> = null,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_INT\r\n ): InternalTexture {\r\n const target = is3D ? this._gl.TEXTURE_3D : this._gl.TEXTURE_2D_ARRAY;\r\n const source = is3D ? InternalTextureSource.Raw3D : InternalTextureSource.Raw2DArray;\r\n const texture = new InternalTexture(this, source);\r\n texture.baseWidth = width;\r\n texture.baseHeight = height;\r\n texture.baseDepth = depth;\r\n texture.width = width;\r\n texture.height = height;\r\n texture.depth = depth;\r\n texture.format = format;\r\n texture.type = textureType;\r\n texture.generateMipMaps = generateMipMaps;\r\n texture.samplingMode = samplingMode;\r\n if (is3D) {\r\n texture.is3D = true;\r\n } else {\r\n texture.is2DArray = true;\r\n }\r\n\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferView = data;\r\n }\r\n\r\n if (is3D) {\r\n this.updateRawTexture3D(texture, data, format, invertY, compression, textureType);\r\n } else {\r\n this.updateRawTexture2DArray(texture, data, format, invertY, compression, textureType);\r\n }\r\n this._bindTextureDirectly(target, texture, true);\r\n\r\n // Filters\r\n const filters = this._getSamplingParameters(samplingMode, generateMipMaps);\r\n\r\n this._gl.texParameteri(target, this._gl.TEXTURE_MAG_FILTER, filters.mag);\r\n this._gl.texParameteri(target, this._gl.TEXTURE_MIN_FILTER, filters.min);\r\n\r\n if (generateMipMaps) {\r\n this._gl.generateMipmap(target);\r\n }\r\n\r\n this._bindTextureDirectly(target, null);\r\n\r\n this._internalTexturesCache.push(texture);\r\n\r\n return texture;\r\n };\r\n}\r\n\r\nThinEngine.prototype.createRawTexture2DArray = _makeCreateRawTextureFunction(false);\r\nThinEngine.prototype.createRawTexture3D = _makeCreateRawTextureFunction(true);\r\n\r\n/**\r\n * Create a function for updateRawTexture3D/updateRawTexture2DArray\r\n * @param is3D true for TEXTURE_3D and false for TEXTURE_2D_ARRAY\r\n * @hidden\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nfunction _makeUpdateRawTextureFunction(is3D: boolean) {\r\n return function (\r\n this: ThinEngine,\r\n texture: InternalTexture,\r\n data: Nullable<ArrayBufferView>,\r\n format: number,\r\n invertY: boolean,\r\n compression: Nullable<string> = null,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_INT\r\n ): void {\r\n const target = is3D ? this._gl.TEXTURE_3D : this._gl.TEXTURE_2D_ARRAY;\r\n const internalType = this._getWebGLTextureType(textureType);\r\n const internalFormat = this._getInternalFormat(format);\r\n const internalSizedFomat = this._getRGBABufferInternalSizedFormat(textureType, format);\r\n\r\n this._bindTextureDirectly(target, texture, true);\r\n this._unpackFlipY(invertY === undefined ? true : invertY ? true : false);\r\n\r\n if (!this._doNotHandleContextLost) {\r\n texture._bufferView = data;\r\n texture.format = format;\r\n texture.invertY = invertY;\r\n texture._compression = compression;\r\n }\r\n\r\n if (texture.width % 4 !== 0) {\r\n this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT, 1);\r\n }\r\n\r\n if (compression && data) {\r\n this._gl.compressedTexImage3D(target, 0, (<any>this.getCaps().s3tc)[compression], texture.width, texture.height, texture.depth, 0, data);\r\n } else {\r\n this._gl.texImage3D(target, 0, internalSizedFomat, texture.width, texture.height, texture.depth, 0, internalFormat, internalType, data);\r\n }\r\n\r\n if (texture.generateMipMaps) {\r\n this._gl.generateMipmap(target);\r\n }\r\n this._bindTextureDirectly(target, null);\r\n // this.resetTextureCache();\r\n texture.isReady = true;\r\n };\r\n}\r\n\r\nThinEngine.prototype.updateRawTexture2DArray = _makeUpdateRawTextureFunction(false);\r\nThinEngine.prototype.updateRawTexture3D = _makeUpdateRawTextureFunction(true);\r\n"]}
@@ -1,4 +1,3 @@
1
- import { StartsWith } from "../../Misc/stringTools.js";
2
1
  /** @hidden */
3
2
  var ShaderCodeNode = /** @class */ (function () {
4
3
  function ShaderCodeNode() {
@@ -18,10 +17,10 @@ var ShaderCodeNode = /** @class */ (function () {
18
17
  if (processor.lineProcessor) {
19
18
  value = processor.lineProcessor(value, options.isFragment, options.processingContext);
20
19
  }
21
- if (processor.attributeProcessor && StartsWith(this.line, "attribute")) {
20
+ if (processor.attributeProcessor && this.line.startsWith("attribute")) {
22
21
  value = processor.attributeProcessor(this.line, preprocessors, options.processingContext);
23
22
  }
24
- else if (processor.varyingProcessor && StartsWith(this.line, "varying")) {
23
+ else if (processor.varyingProcessor && this.line.startsWith("varying")) {
25
24
  value = processor.varyingProcessor(this.line, options.isFragment, preprocessors, options.processingContext);
26
25
  }
27
26
  else if (processor.uniformProcessor && processor.uniformRegexp && processor.uniformRegexp.test(this.line)) {
@@ -38,7 +37,7 @@ var ShaderCodeNode = /** @class */ (function () {
38
37
  else if (processor.textureProcessor && processor.textureRegexp && processor.textureRegexp.test(this.line)) {
39
38
  value = processor.textureProcessor(this.line, options.isFragment, preprocessors, options.processingContext);
40
39
  }
41
- else if ((processor.uniformProcessor || processor.uniformBufferProcessor) && StartsWith(this.line, "uniform") && !options.lookForClosingBracketForUniformBuffer) {
40
+ else if ((processor.uniformProcessor || processor.uniformBufferProcessor) && this.line.startsWith("uniform") && !options.lookForClosingBracketForUniformBuffer) {
42
41
  var regex = /uniform\s+(?:(?:highp)?|(?:lowp)?)\s*(\S+)\s+(\S+)\s*;/;
43
42
  if (regex.test(this.line)) {
44
43
  // uniform
@@ -1 +1 @@
1
- {"version":3,"file":"shaderCodeNode.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/Engines/Processors/shaderCodeNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,cAAc;AACd;IAAA;QAEI,aAAQ,GAAqB,EAAE,CAAC;IAyEpC,CAAC;IArEG,6DAA6D;IAC7D,gCAAO,GAAP,UAAQ,aAAwC;QAC5C,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,gCAAO,GAAP,UAAQ,aAAwC,EAAE,OAA0B;QACxE,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI,IAAI,CAAC,IAAI,EAAE;YACX,IAAI,KAAK,GAAW,IAAI,CAAC,IAAI,CAAC;YAC9B,IAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;YACpC,IAAI,SAAS,EAAE;gBACX,+GAA+G;gBAC/G,IAAI,SAAS,CAAC,aAAa,EAAE;oBACzB,KAAK,GAAG,SAAS,CAAC,aAAa,CAAC,KAAK,EAAE,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;iBACzF;gBAED,IAAI,SAAS,CAAC,kBAAkB,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,EAAE;oBACpE,KAAK,GAAG,SAAS,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,aAAa,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;iBAC7F;qBAAM,IAAI,SAAS,CAAC,gBAAgB,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE;oBACvE,KAAK,GAAG,SAAS,CAAC,gBAAgB,CAAC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B,IAAI,MAAM,CAAC;SAClF;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;IACL,qBAAC;AAAD,CAAC,AA3ED,IA2EC","sourcesContent":["import type { ProcessingOptions } from \"./shaderProcessingOptions\";\r\nimport { StartsWith } from \"../../Misc/stringTools\";\r\n\r\n/** @hidden */\r\nexport class ShaderCodeNode {\r\n line: string;\r\n children: ShaderCodeNode[] = [];\r\n additionalDefineKey?: string;\r\n additionalDefineValue?: string;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n isValid(preprocessors: { [key: string]: string }): boolean {\r\n return true;\r\n }\r\n\r\n process(preprocessors: { [key: string]: string }, options: ProcessingOptions): string {\r\n let result = \"\";\r\n if (this.line) {\r\n let value: string = this.line;\r\n const processor = options.processor;\r\n if (processor) {\r\n // This must be done before other replacements to avoid mistakenly changing something that was already changed.\r\n if (processor.lineProcessor) {\r\n value = processor.lineProcessor(value, options.isFragment, options.processingContext);\r\n }\r\n\r\n if (processor.attributeProcessor && StartsWith(this.line, \"attribute\")) {\r\n value = processor.attributeProcessor(this.line, preprocessors, options.processingContext);\r\n } else if (processor.varyingProcessor && StartsWith(this.line, \"varying\")) {\r\n value = processor.varyingProcessor(this.line, options.isFragment, preprocessors, options.processingContext);\r\n } else if (processor.uniformProcessor && processor.uniformRegexp && processor.uniformRegexp.test(this.line)) {\r\n if (!options.lookForClosingBracketForUniformBuffer) {\r\n value = processor.uniformProcessor(this.line, options.isFragment, preprocessors, options.processingContext);\r\n }\r\n } else if (processor.uniformBufferProcessor && processor.uniformBufferRegexp && processor.uniformBufferRegexp.test(this.line)) {\r\n if (!options.lookForClosingBracketForUniformBuffer) {\r\n value = processor.uniformBufferProcessor(this.line, options.isFragment, options.processingContext);\r\n options.lookForClosingBracketForUniformBuffer = true;\r\n }\r\n } else if (processor.textureProcessor && processor.textureRegexp && processor.textureRegexp.test(this.line)) {\r\n value = processor.textureProcessor(this.line, options.isFragment, preprocessors, options.processingContext);\r\n } else if ((processor.uniformProcessor || processor.uniformBufferProcessor) && StartsWith(this.line, \"uniform\") && !options.lookForClosingBracketForUniformBuffer) {\r\n const regex = /uniform\\s+(?:(?:highp)?|(?:lowp)?)\\s*(\\S+)\\s+(\\S+)\\s*;/;\r\n\r\n if (regex.test(this.line)) {\r\n // uniform\r\n if (processor.uniformProcessor) {\r\n value = processor.uniformProcessor(this.line, options.isFragment, preprocessors, options.processingContext);\r\n }\r\n } else {\r\n // Uniform buffer\r\n if (processor.uniformBufferProcessor) {\r\n value = processor.uniformBufferProcessor(this.line, options.isFragment, options.processingContext);\r\n options.lookForClosingBracketForUniformBuffer = true;\r\n }\r\n }\r\n }\r\n\r\n if (options.lookForClosingBracketForUniformBuffer && this.line.indexOf(\"}\") !== -1) {\r\n options.lookForClosingBracketForUniformBuffer = false;\r\n if (processor.endOfUniformBufferProcessor) {\r\n value = processor.endOfUniformBufferProcessor(this.line, options.isFragment, options.processingContext);\r\n }\r\n }\r\n }\r\n\r\n result += value + \"\\r\\n\";\r\n }\r\n\r\n this.children.forEach((child) => {\r\n result += child.process(preprocessors, options);\r\n });\r\n\r\n if (this.additionalDefineKey) {\r\n preprocessors[this.additionalDefineKey] = this.additionalDefineValue || \"true\";\r\n }\r\n\r\n return result;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"shaderCodeNode.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/Engines/Processors/shaderCodeNode.ts"],"names":[],"mappings":"AAEA,cAAc;AACd;IAAA;QAEI,aAAQ,GAAqB,EAAE,CAAC;IAyEpC,CAAC;IArEG,6DAA6D;IAC7D,gCAAO,GAAP,UAAQ,aAAwC;QAC5C,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,gCAAO,GAAP,UAAQ,aAAwC,EAAE,OAA0B;QACxE,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI,IAAI,CAAC,IAAI,EAAE;YACX,IAAI,KAAK,GAAW,IAAI,CAAC,IAAI,CAAC;YAC9B,IAAM,SAA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CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE;oBAChF,OAAO,CAAC,qCAAqC,GAAG,KAAK,CAAC;oBACtD,IAAI,SAAS,CAAC,2BAA2B,EAAE;wBACvC,KAAK,GAAG,SAAS,CAAC,2BAA2B,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;qBAC3G;iBACJ;aACJ;YAED,MAAM,IAAI,KAAK,GAAG,MAAM,CAAC;SAC5B;QAED,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAC,KAAK;YACxB,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;QAEH,IAAI,IAAI,CAAC,mBAAmB,EAAE;YAC1B,aAAa,CAAC,IAAI,CAAC,mBAAmB,CAAC,GAAG,IAAI,CAAC,qBAAqB,IAAI,MAAM,CAAC;SAClF;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;IACL,qBAAC;AAAD,CAAC,AA3ED,IA2EC","sourcesContent":["import type { ProcessingOptions } from \"./shaderProcessingOptions\";\r\n\r\n/** @hidden */\r\nexport class ShaderCodeNode {\r\n line: string;\r\n children: ShaderCodeNode[] = [];\r\n additionalDefineKey?: string;\r\n additionalDefineValue?: string;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n isValid(preprocessors: { [key: string]: string }): boolean {\r\n return true;\r\n }\r\n\r\n process(preprocessors: { [key: string]: string }, options: ProcessingOptions): string {\r\n let result = \"\";\r\n if (this.line) {\r\n let value: string = this.line;\r\n const processor = options.processor;\r\n if (processor) {\r\n // This must be done before other replacements to avoid mistakenly changing something that was already changed.\r\n if (processor.lineProcessor) {\r\n value = processor.lineProcessor(value, options.isFragment, options.processingContext);\r\n }\r\n\r\n if (processor.attributeProcessor && this.line.startsWith(\"attribute\")) {\r\n value = processor.attributeProcessor(this.line, preprocessors, options.processingContext);\r\n } else if (processor.varyingProcessor && this.line.startsWith(\"varying\")) {\r\n value = processor.varyingProcessor(this.line, options.isFragment, preprocessors, options.processingContext);\r\n } else if (processor.uniformProcessor && processor.uniformRegexp && processor.uniformRegexp.test(this.line)) {\r\n if (!options.lookForClosingBracketForUniformBuffer) {\r\n value = processor.uniformProcessor(this.line, options.isFragment, preprocessors, options.processingContext);\r\n }\r\n } else if (processor.uniformBufferProcessor && processor.uniformBufferRegexp && processor.uniformBufferRegexp.test(this.line)) {\r\n if (!options.lookForClosingBracketForUniformBuffer) {\r\n value = processor.uniformBufferProcessor(this.line, options.isFragment, options.processingContext);\r\n options.lookForClosingBracketForUniformBuffer = true;\r\n }\r\n } else if (processor.textureProcessor && processor.textureRegexp && processor.textureRegexp.test(this.line)) {\r\n value = processor.textureProcessor(this.line, options.isFragment, preprocessors, options.processingContext);\r\n } else if ((processor.uniformProcessor || processor.uniformBufferProcessor) && this.line.startsWith(\"uniform\") && !options.lookForClosingBracketForUniformBuffer) {\r\n const regex = /uniform\\s+(?:(?:highp)?|(?:lowp)?)\\s*(\\S+)\\s+(\\S+)\\s*;/;\r\n\r\n if (regex.test(this.line)) {\r\n // uniform\r\n if (processor.uniformProcessor) {\r\n value = processor.uniformProcessor(this.line, options.isFragment, preprocessors, options.processingContext);\r\n }\r\n } else {\r\n // Uniform buffer\r\n if (processor.uniformBufferProcessor) {\r\n value = processor.uniformBufferProcessor(this.line, options.isFragment, options.processingContext);\r\n options.lookForClosingBracketForUniformBuffer = true;\r\n }\r\n }\r\n }\r\n\r\n if (options.lookForClosingBracketForUniformBuffer && this.line.indexOf(\"}\") !== -1) {\r\n options.lookForClosingBracketForUniformBuffer = false;\r\n if (processor.endOfUniformBufferProcessor) {\r\n value = processor.endOfUniformBufferProcessor(this.line, options.isFragment, options.processingContext);\r\n }\r\n }\r\n }\r\n\r\n result += value + \"\\r\\n\";\r\n }\r\n\r\n this.children.forEach((child) => {\r\n result += child.process(preprocessors, options);\r\n });\r\n\r\n if (this.additionalDefineKey) {\r\n preprocessors[this.additionalDefineKey] = this.additionalDefineValue || \"true\";\r\n }\r\n\r\n return result;\r\n }\r\n}\r\n"]}
@@ -1365,7 +1365,6 @@ interface WorkerNavigator {
1365
1365
  }
1366
1366
 
1367
1367
  class GPU {
1368
- private __brand: void;
1369
1368
  requestAdapter(options?: GPURequestAdapterOptions): Promise<GPUAdapter | null>;
1370
1369
  getPreferredCanvasFormat(): GPUTextureFormat;
1371
1370
  }
@@ -1379,7 +1378,6 @@ type GPUPowerPreference = "low-power" | "high-performance";
1379
1378
 
1380
1379
  class GPUAdapter {
1381
1380
  // https://michalzalecki.com/nominal-typing-in-typescript/#approach-1-class-with-a-private-property
1382
- private __brand: void;
1383
1381
  readonly name: string;
1384
1382
  readonly features: GPUSupportedFeatures;
1385
1383
  readonly limits: GPUSupportedLimits;
@@ -1407,7 +1405,6 @@ type GPUFeatureName =
1407
1405
  | "bgra8unorm-storage";
1408
1406
 
1409
1407
  class GPUDevice extends EventTarget implements GPUObjectBase {
1410
- private __brand: void;
1411
1408
  label: string | undefined;
1412
1409
 
1413
1410
  readonly features: GPUSupportedFeatures;
@@ -1445,7 +1442,6 @@ class GPUDevice extends EventTarget implements GPUObjectBase {
1445
1442
  }
1446
1443
 
1447
1444
  class GPUBuffer implements GPUObjectBase {
1448
- private __brand: void;
1449
1445
  label: string | undefined;
1450
1446
 
1451
1447
  mapAsync(mode: GPUMapModeFlags, offset?: GPUSize64 /*default=0*/, size?: GPUSize64): Promise<void>;
@@ -1466,7 +1462,6 @@ type GPUBufferUsageFlags = number;
1466
1462
  type GPUMapModeFlags = number;
1467
1463
 
1468
1464
  class GPUTexture implements GPUObjectBase {
1469
- private __brand: void;
1470
1465
  label: string | undefined;
1471
1466
 
1472
1467
  createView(descriptor?: GPUTextureViewDescriptor): GPUTextureView;
@@ -1488,7 +1483,6 @@ type GPUTextureDimension = "1d" | "2d" | "3d";
1488
1483
  type GPUTextureUsageFlags = number;
1489
1484
 
1490
1485
  class GPUTextureView implements GPUObjectBase {
1491
- private __brand: void;
1492
1486
  label: string | undefined;
1493
1487
  }
1494
1488
 
@@ -1629,7 +1623,6 @@ type GPUTextureFormat =
1629
1623
  | "astc-12x12-unorm-srgb";
1630
1624
 
1631
1625
  class GPUExternalTexture implements GPUObjectBase {
1632
- private __brand: void;
1633
1626
  label: string | undefined;
1634
1627
  }
1635
1628
 
@@ -1639,7 +1632,6 @@ interface GPUExternalTextureDescriptor extends GPUObjectDescriptorBase {
1639
1632
  }
1640
1633
 
1641
1634
  class GPUSampler implements GPUObjectBase {
1642
- private __brand: void;
1643
1635
  label: string | undefined;
1644
1636
  }
1645
1637
 
@@ -1663,7 +1655,6 @@ type GPUFilterMode = "nearest" | "linear";
1663
1655
  type GPUCompareFunction = "never" | "less" | "equal" | "less-equal" | "greater" | "not-equal" | "greater-equal" | "always";
1664
1656
 
1665
1657
  class GPUBindGroupLayout implements GPUObjectBase {
1666
- private __brand: void;
1667
1658
  label: string | undefined;
1668
1659
  }
1669
1660
 
@@ -1717,7 +1708,6 @@ interface GPUStorageTextureBindingLayout {
1717
1708
  interface GPUExternalTextureBindingLayout {}
1718
1709
 
1719
1710
  class GPUBindGroup implements GPUObjectBase {
1720
- private __brand: void;
1721
1711
  label: string | undefined;
1722
1712
  }
1723
1713
 
@@ -1740,7 +1730,6 @@ interface GPUBufferBinding {
1740
1730
  }
1741
1731
 
1742
1732
  class GPUPipelineLayout implements GPUObjectBase {
1743
- private __brand: void;
1744
1733
  label: string | undefined;
1745
1734
  }
1746
1735
 
@@ -1749,7 +1738,6 @@ interface GPUPipelineLayoutDescriptor extends GPUObjectDescriptorBase {
1749
1738
  }
1750
1739
 
1751
1740
  class GPUShaderModule implements GPUObjectBase {
1752
- private __brand: void;
1753
1741
  label: string | undefined;
1754
1742
 
1755
1743
  compilationInfo(): Promise<GPUCompilationInfo>;
@@ -1799,7 +1787,6 @@ interface GPUProgrammableStage {
1799
1787
  type GPUPipelineConstantValue = number; // May represent WGSL’s bool, f32, i32, u32, and f16 if enabled.
1800
1788
 
1801
1789
  class GPUComputePipeline implements GPUObjectBase, GPUPipelineBase {
1802
- private __brand: void;
1803
1790
  label: string | undefined;
1804
1791
 
1805
1792
  getBindGroupLayout(index: number): GPUBindGroupLayout;
@@ -1810,7 +1797,6 @@ interface GPUComputePipelineDescriptor extends GPUPipelineDescriptorBase {
1810
1797
  }
1811
1798
 
1812
1799
  class GPURenderPipeline implements GPUObjectBase, GPUPipelineBase {
1813
- private __brand: void;
1814
1800
  label: string | undefined;
1815
1801
 
1816
1802
  getBindGroupLayout(index: number): GPUBindGroupLayout;
@@ -1966,7 +1952,6 @@ interface GPUVertexAttribute {
1966
1952
  }
1967
1953
 
1968
1954
  class GPUCommandBuffer implements GPUObjectBase {
1969
- private __brand: void;
1970
1955
  label: string | undefined;
1971
1956
  }
1972
1957
 
@@ -1975,7 +1960,6 @@ interface GPUCommandBufferDescriptor extends GPUObjectDescriptorBase {}
1975
1960
  interface GPUCommandsMixin {}
1976
1961
 
1977
1962
  class GPUCommandEncoder implements GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin {
1978
- private __brand: void;
1979
1963
  label: string | undefined;
1980
1964
 
1981
1965
  beginRenderPass(descriptor: GPURenderPassDescriptor): GPURenderPassEncoder;
@@ -2040,7 +2024,6 @@ interface GPUDebugCommandsMixin {
2040
2024
  }
2041
2025
 
2042
2026
  class GPUComputePassEncoder implements GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin, GPUBindingCommandsMixin {
2043
- private __brand: void;
2044
2027
  label: string | undefined;
2045
2028
 
2046
2029
  setBindGroup(index: number, bindGroup: GPUBindGroup, dynamicOffsets?: GPUBufferDynamicOffset[]): void;
@@ -2072,7 +2055,6 @@ interface GPUComputePassDescriptor extends GPUObjectDescriptorBase {
2072
2055
  }
2073
2056
 
2074
2057
  class GPURenderPassEncoder implements GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin, GPUBindingCommandsMixin, GPURenderCommandsMixin {
2075
- private __brand: void;
2076
2058
  label: string | undefined;
2077
2059
 
2078
2060
  setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup, dynamicOffsets?: GPUBufferDynamicOffset[]): void;
@@ -2183,14 +2165,12 @@ interface GPURenderCommandsMixin {
2183
2165
  }
2184
2166
 
2185
2167
  class GPURenderBundle implements GPUObjectBase {
2186
- private __brand: void;
2187
2168
  label: string | undefined;
2188
2169
  }
2189
2170
 
2190
2171
  interface GPURenderBundleDescriptor extends GPUObjectDescriptorBase {}
2191
2172
 
2192
2173
  class GPURenderBundleEncoder implements GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin, GPUBindingCommandsMixin, GPURenderCommandsMixin {
2193
- private __brand: void;
2194
2174
  label: string | undefined;
2195
2175
 
2196
2176
  setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup, dynamicOffsets?: GPUBufferDynamicOffset[]): void;
@@ -2228,7 +2208,6 @@ interface GPURenderBundleEncoderDescriptor extends GPURenderPassLayout {
2228
2208
  interface GPUQueueDescriptor extends GPUObjectDescriptorBase {}
2229
2209
 
2230
2210
  class GPUQueue implements GPUObjectBase {
2231
- private __brand: void;
2232
2211
  label: string | undefined;
2233
2212
 
2234
2213
  submit(commandBuffers: GPUCommandBuffer[]): void;
@@ -2243,7 +2222,6 @@ class GPUQueue implements GPUObjectBase {
2243
2222
  }
2244
2223
 
2245
2224
  class GPUQuerySet implements GPUObjectBase {
2246
- private __brand: void;
2247
2225
  label: string | undefined;
2248
2226
 
2249
2227
  destroy(): void;
@@ -2257,8 +2235,6 @@ interface GPUQuerySetDescriptor extends GPUObjectDescriptorBase {
2257
2235
  type GPUQueryType = "occlusion" | "timestamp";
2258
2236
 
2259
2237
  class GPUCanvasContext {
2260
- private __brand: void;
2261
-
2262
2238
  readonly canvas: HTMLCanvasElement | OffscreenCanvas;
2263
2239
 
2264
2240
  configure(configuration?: GPUCanvasConfiguration): void;
@@ -2281,7 +2257,6 @@ interface GPUCanvasConfiguration extends GPUObjectDescriptorBase {
2281
2257
  type GPUDeviceLostReason = "destroyed";
2282
2258
 
2283
2259
  class GPUDeviceLostInfo {
2284
- private __brand: void;
2285
2260
  readonly reason?: GPUDeviceLostReason;
2286
2261
  readonly message: string;
2287
2262
  }
@@ -2289,24 +2264,20 @@ class GPUDeviceLostInfo {
2289
2264
  type GPUErrorFilter = "out-of-memory" | "validation";
2290
2265
 
2291
2266
  class GPUError {
2292
- private __brand: void;
2293
2267
  readonly message: string;
2294
2268
  }
2295
2269
 
2296
- class GPUOutOfMemoryError implements GPUError {
2297
- private __brand: void;
2270
+ class GPUOutOfMemoryError extends GPUError {
2298
2271
  constructor();
2299
2272
  readonly message: string;
2300
2273
  }
2301
2274
 
2302
- class GPUValidationError implements GPUError {
2303
- private __brand: void;
2275
+ class GPUValidationError extends GPUError {
2304
2276
  constructor(message: string);
2305
2277
  readonly message: string;
2306
2278
  }
2307
2279
 
2308
2280
  class GPUUncapturedErrorEvent extends Event {
2309
- private __brand: void;
2310
2281
  constructor(type: string, gpuUncapturedErrorEventInitDict: GPUUncapturedErrorEventInit);
2311
2282
  readonly error: GPUError;
2312
2283
  }
@@ -601,7 +601,9 @@ var NullEngine = /** @class */ (function (_super) {
601
601
  }
602
602
  texture.isReady = true;
603
603
  if (onLoad) {
604
- onLoad();
604
+ setTimeout(function () {
605
+ onLoad();
606
+ });
605
607
  }
606
608
  this._internalTexturesCache.push(texture);
607
609
  return texture;