engine.cubeTexture.d.ts 5.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import { InternalTexture } from "../../Materials/Textures/internalTexture";
  2. import type { Nullable } from "../../types";
  3. import type { Scene } from "../../scene";
  4. import type { DepthTextureCreationOptions } from "../../Materials/Textures/textureCreationOptions";
  5. declare module "../../Engines/thinEngine" {
  6. interface ThinEngine {
  7. /**
  8. * Creates a depth stencil cube texture.
  9. * This is only available in WebGL 2.
  10. * @param size The size of face edge in the cube texture.
  11. * @param options The options defining the cube texture.
  12. * @returns The cube texture
  13. */
  14. _createDepthStencilCubeTexture(size: number, options: DepthTextureCreationOptions): InternalTexture;
  15. /**
  16. * Creates a cube texture
  17. * @param rootUrl defines the url where the files to load is located
  18. * @param scene defines the current scene
  19. * @param files defines the list of files to load (1 per face)
  20. * @param noMipmap defines a boolean indicating that no mipmaps shall be generated (false by default)
  21. * @param onLoad defines an optional callback raised when the texture is loaded
  22. * @param onError defines an optional callback raised if there is an issue to load the texture
  23. * @param format defines the format of the data
  24. * @param forcedExtension defines the extension to use to pick the right loader
  25. * @param createPolynomials if a polynomial sphere should be created for the cube texture
  26. * @param lodScale defines the scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness
  27. * @param lodOffset defines the offset applied to environment texture. This manages first LOD level used for IBL according to the roughness
  28. * @param fallback defines texture to use while falling back when (compressed) texture file not found.
  29. * @param loaderOptions options to be passed to the loader
  30. * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
  31. * @returns the cube texture as an InternalTexture
  32. */
  33. createCubeTexture(rootUrl: string, scene: Nullable<Scene>, files: Nullable<string[]>, noMipmap: boolean | undefined, onLoad: Nullable<(data?: any) => void>, onError: Nullable<(message?: string, exception?: any) => void>, format: number | undefined, forcedExtension: any, createPolynomials: boolean, lodScale: number, lodOffset: number, fallback: Nullable<InternalTexture>, loaderOptions: any, useSRGBBuffer: boolean): InternalTexture;
  34. /**
  35. * Creates a cube texture
  36. * @param rootUrl defines the url where the files to load is located
  37. * @param scene defines the current scene
  38. * @param files defines the list of files to load (1 per face)
  39. * @param noMipmap defines a boolean indicating that no mipmaps shall be generated (false by default)
  40. * @param onLoad defines an optional callback raised when the texture is loaded
  41. * @param onError defines an optional callback raised if there is an issue to load the texture
  42. * @param format defines the format of the data
  43. * @param forcedExtension defines the extension to use to pick the right loader
  44. * @returns the cube texture as an InternalTexture
  45. */
  46. createCubeTexture(rootUrl: string, scene: Nullable<Scene>, files: Nullable<string[]>, noMipmap: boolean, onLoad: Nullable<(data?: any) => void>, onError: Nullable<(message?: string, exception?: any) => void>, format: number | undefined, forcedExtension: any): InternalTexture;
  47. /**
  48. * Creates a cube texture
  49. * @param rootUrl defines the url where the files to load is located
  50. * @param scene defines the current scene
  51. * @param files defines the list of files to load (1 per face)
  52. * @param noMipmap defines a boolean indicating that no mipmaps shall be generated (false by default)
  53. * @param onLoad defines an optional callback raised when the texture is loaded
  54. * @param onError defines an optional callback raised if there is an issue to load the texture
  55. * @param format defines the format of the data
  56. * @param forcedExtension defines the extension to use to pick the right loader
  57. * @param createPolynomials if a polynomial sphere should be created for the cube texture
  58. * @param lodScale defines the scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness
  59. * @param lodOffset defines the offset applied to environment texture. This manages first LOD level used for IBL according to the roughness
  60. * @returns the cube texture as an InternalTexture
  61. */
  62. createCubeTexture(rootUrl: string, scene: Nullable<Scene>, files: Nullable<string[]>, noMipmap: boolean, onLoad: Nullable<(data?: any) => void>, onError: Nullable<(message?: string, exception?: any) => void>, format: number | undefined, forcedExtension: any, createPolynomials: boolean, lodScale: number, lodOffset: number): InternalTexture;
  63. /** @internal */
  64. createCubeTextureBase(rootUrl: string, scene: Nullable<Scene>, files: Nullable<string[]>, noMipmap: boolean, onLoad: Nullable<(data?: any) => void>, onError: Nullable<(message?: string, exception?: any) => void>, format: number | undefined, forcedExtension: any, createPolynomials: boolean, lodScale: number, lodOffset: number, fallback: Nullable<InternalTexture>, beforeLoadCubeDataCallback: Nullable<(texture: InternalTexture, data: ArrayBufferView | ArrayBufferView[]) => void>, imageHandler: Nullable<(texture: InternalTexture, imgs: HTMLImageElement[] | ImageBitmap[]) => void>, useSRGBBuffer: boolean): InternalTexture;
  65. /**
  66. * @internal
  67. */
  68. _setCubeMapTextureParams(texture: InternalTexture, loadMipmap: boolean, maxLevel?: number): void;
  69. }
  70. }