engine.rawTexture.d.ts 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. import type { Nullable } from "../../types";
  2. import { InternalTexture } from "../../Materials/Textures/internalTexture";
  3. import type { Scene } from "../../scene";
  4. declare module "../../Engines/thinEngine" {
  5. interface ThinEngine {
  6. /**
  7. * Creates a raw texture
  8. * @param data defines the data to store in the texture
  9. * @param width defines the width of the texture
  10. * @param height defines the height of the texture
  11. * @param format defines the format of the data
  12. * @param generateMipMaps defines if the engine should generate the mip levels
  13. * @param invertY defines if data must be stored with Y axis inverted
  14. * @param samplingMode defines the required sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
  15. * @param compression defines the compression used (null by default)
  16. * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
  17. * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)
  18. * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
  19. * @returns the raw texture inside an InternalTexture
  20. */
  21. createRawTexture(data: Nullable<ArrayBufferView>, width: number, height: number, format: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression: Nullable<string>, type: number, creationFlags?: number, useSRGBBuffer?: boolean): InternalTexture;
  22. /**
  23. * Update a raw texture
  24. * @param texture defines the texture to update
  25. * @param data defines the data to store in the texture
  26. * @param format defines the format of the data
  27. * @param invertY defines if data must be stored with Y axis inverted
  28. */
  29. updateRawTexture(texture: Nullable<InternalTexture>, data: Nullable<ArrayBufferView>, format: number, invertY: boolean): void;
  30. /**
  31. * Update a raw texture
  32. * @param texture defines the texture to update
  33. * @param data defines the data to store in the texture
  34. * @param format defines the format of the data
  35. * @param invertY defines if data must be stored with Y axis inverted
  36. * @param compression defines the compression used (null by default)
  37. * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
  38. * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
  39. */
  40. updateRawTexture(texture: Nullable<InternalTexture>, data: Nullable<ArrayBufferView>, format: number, invertY: boolean, compression: Nullable<string>, type: number, useSRGBBuffer: boolean): void;
  41. /**
  42. * Creates a new raw cube texture
  43. * @param data defines the array of data to use to create each face
  44. * @param size defines the size of the textures
  45. * @param format defines the format of the data
  46. * @param type defines the type of the data (like Engine.TEXTURETYPE_UNSIGNED_INT)
  47. * @param generateMipMaps defines if the engine should generate the mip levels
  48. * @param invertY defines if data must be stored with Y axis inverted
  49. * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)
  50. * @param compression defines the compression used (null by default)
  51. * @returns the cube texture as an InternalTexture
  52. */
  53. createRawCubeTexture(data: Nullable<ArrayBufferView[]>, size: number, format: number, type: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression: Nullable<string>): InternalTexture;
  54. /**
  55. * Update a raw cube texture
  56. * @param texture defines the texture to update
  57. * @param data defines the data to store
  58. * @param format defines the data format
  59. * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
  60. * @param invertY defines if data must be stored with Y axis inverted
  61. */
  62. updateRawCubeTexture(texture: InternalTexture, data: ArrayBufferView[], format: number, type: number, invertY: boolean): void;
  63. /**
  64. * Update a raw cube texture
  65. * @param texture defines the texture to update
  66. * @param data defines the data to store
  67. * @param format defines the data format
  68. * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
  69. * @param invertY defines if data must be stored with Y axis inverted
  70. * @param compression defines the compression used (null by default)
  71. */
  72. updateRawCubeTexture(texture: InternalTexture, data: ArrayBufferView[], format: number, type: number, invertY: boolean, compression: Nullable<string>): void;
  73. /**
  74. * Update a raw cube texture
  75. * @param texture defines the texture to update
  76. * @param data defines the data to store
  77. * @param format defines the data format
  78. * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
  79. * @param invertY defines if data must be stored with Y axis inverted
  80. * @param compression defines the compression used (null by default)
  81. * @param level defines which level of the texture to update
  82. */
  83. updateRawCubeTexture(texture: InternalTexture, data: ArrayBufferView[], format: number, type: number, invertY: boolean, compression: Nullable<string>, level: number): void;
  84. /**
  85. * Creates a new raw cube texture from a specified url
  86. * @param url defines the url where the data is located
  87. * @param scene defines the current scene
  88. * @param size defines the size of the textures
  89. * @param format defines the format of the data
  90. * @param type defines the type fo the data (like Engine.TEXTURETYPE_UNSIGNED_INT)
  91. * @param noMipmap defines if the engine should avoid generating the mip levels
  92. * @param callback defines a callback used to extract texture data from loaded data
  93. * @param mipmapGenerator defines to provide an optional tool to generate mip levels
  94. * @param onLoad defines a callback called when texture is loaded
  95. * @param onError defines a callback called if there is an error
  96. * @returns the cube texture as an InternalTexture
  97. */
  98. createRawCubeTextureFromUrl(url: string, scene: Nullable<Scene>, size: number, format: number, type: number, noMipmap: boolean, callback: (ArrayBuffer: ArrayBuffer) => Nullable<ArrayBufferView[]>, mipmapGenerator: Nullable<(faces: ArrayBufferView[]) => ArrayBufferView[][]>, onLoad: Nullable<() => void>, onError: Nullable<(message?: string, exception?: any) => void>): InternalTexture;
  99. /**
  100. * Creates a new raw cube texture from a specified url
  101. * @param url defines the url where the data is located
  102. * @param scene defines the current scene
  103. * @param size defines the size of the textures
  104. * @param format defines the format of the data
  105. * @param type defines the type fo the data (like Engine.TEXTURETYPE_UNSIGNED_INT)
  106. * @param noMipmap defines if the engine should avoid generating the mip levels
  107. * @param callback defines a callback used to extract texture data from loaded data
  108. * @param mipmapGenerator defines to provide an optional tool to generate mip levels
  109. * @param onLoad defines a callback called when texture is loaded
  110. * @param onError defines a callback called if there is an error
  111. * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)
  112. * @param invertY defines if data must be stored with Y axis inverted
  113. * @returns the cube texture as an InternalTexture
  114. */
  115. createRawCubeTextureFromUrl(url: string, scene: Nullable<Scene>, size: number, format: number, type: number, noMipmap: boolean, callback: (ArrayBuffer: ArrayBuffer) => Nullable<ArrayBufferView[]>, mipmapGenerator: Nullable<(faces: ArrayBufferView[]) => ArrayBufferView[][]>, onLoad: Nullable<() => void>, onError: Nullable<(message?: string, exception?: any) => void>, samplingMode: number, invertY: boolean): InternalTexture;
  116. /**
  117. * Creates a new raw 3D texture
  118. * @param data defines the data used to create the texture
  119. * @param width defines the width of the texture
  120. * @param height defines the height of the texture
  121. * @param depth defines the depth of the texture
  122. * @param format defines the format of the texture
  123. * @param generateMipMaps defines if the engine must generate mip levels
  124. * @param invertY defines if data must be stored with Y axis inverted
  125. * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)
  126. * @param compression defines the compressed used (can be null)
  127. * @param textureType defines the compressed used (can be null)
  128. * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)
  129. * @returns a new raw 3D texture (stored in an InternalTexture)
  130. */
  131. createRawTexture3D(data: Nullable<ArrayBufferView>, width: number, height: number, depth: number, format: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression: Nullable<string>, textureType: number, creationFlags?: number): InternalTexture;
  132. /**
  133. * Update a raw 3D texture
  134. * @param texture defines the texture to update
  135. * @param data defines the data to store
  136. * @param format defines the data format
  137. * @param invertY defines if data must be stored with Y axis inverted
  138. */
  139. updateRawTexture3D(texture: InternalTexture, data: Nullable<ArrayBufferView>, format: number, invertY: boolean): void;
  140. /**
  141. * Update a raw 3D texture
  142. * @param texture defines the texture to update
  143. * @param data defines the data to store
  144. * @param format defines the data format
  145. * @param invertY defines if data must be stored with Y axis inverted
  146. * @param compression defines the used compression (can be null)
  147. * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_INT, Engine.TEXTURETYPE_FLOAT...)
  148. */
  149. updateRawTexture3D(texture: InternalTexture, data: Nullable<ArrayBufferView>, format: number, invertY: boolean, compression: Nullable<string>, textureType: number): void;
  150. /**
  151. * Creates a new raw 2D array texture
  152. * @param data defines the data used to create the texture
  153. * @param width defines the width of the texture
  154. * @param height defines the height of the texture
  155. * @param depth defines the number of layers of the texture
  156. * @param format defines the format of the texture
  157. * @param generateMipMaps defines if the engine must generate mip levels
  158. * @param invertY defines if data must be stored with Y axis inverted
  159. * @param samplingMode defines the required sampling mode (like Texture.NEAREST_SAMPLINGMODE)
  160. * @param compression defines the compressed used (can be null)
  161. * @param textureType defines the compressed used (can be null)
  162. * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)
  163. * @returns a new raw 2D array texture (stored in an InternalTexture)
  164. */
  165. createRawTexture2DArray(data: Nullable<ArrayBufferView>, width: number, height: number, depth: number, format: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression: Nullable<string>, textureType: number, creationFlags?: number): InternalTexture;
  166. /**
  167. * Update a raw 2D array texture
  168. * @param texture defines the texture to update
  169. * @param data defines the data to store
  170. * @param format defines the data format
  171. * @param invertY defines if data must be stored with Y axis inverted
  172. */
  173. updateRawTexture2DArray(texture: InternalTexture, data: Nullable<ArrayBufferView>, format: number, invertY: boolean): void;
  174. /**
  175. * Update a raw 2D array texture
  176. * @param texture defines the texture to update
  177. * @param data defines the data to store
  178. * @param format defines the data format
  179. * @param invertY defines if data must be stored with Y axis inverted
  180. * @param compression defines the used compression (can be null)
  181. * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_INT, Engine.TEXTURETYPE_FLOAT...)
  182. */
  183. updateRawTexture2DArray(texture: InternalTexture, data: Nullable<ArrayBufferView>, format: number, invertY: boolean, compression: Nullable<string>, textureType: number): void;
  184. }
  185. }