equirectangularCapture.d.ts 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import type { Scene } from "../scene";
  2. import { ReflectionProbe } from "../Probes/reflectionProbe";
  3. import type { AbstractMesh } from "../Meshes/abstractMesh";
  4. import type { Vector3 } from "../Maths/math.vector";
  5. import "../Shaders/equirectangularPanorama.fragment";
  6. /**
  7. * Interface containing options related to equirectangular capture of the current scene
  8. */
  9. export interface EquiRectangularCaptureOptions {
  10. /**
  11. * This option relates to smallest dimension of the given equirectangular capture
  12. * Giving a 512px size would result in an image that 512 x 1024px
  13. */
  14. size: number;
  15. /**
  16. * Optional function to map which meshes should get rendered on the equirectangular map
  17. * This is specifically helpful when you have certain meshes that you want to skip, especially ground
  18. */
  19. meshesFilter?: (mesh: AbstractMesh) => boolean;
  20. /**
  21. * Optional argument to specify filename, passing this would auto download the given file
  22. */
  23. filename?: string;
  24. /**
  25. * Optional argument to specify position in 3D Space from where the equirectangular capture should be taken, if not specified, it would take the position of the scene's active camera or else origin
  26. */
  27. position?: Vector3;
  28. /**
  29. * Optional argument to specify probe with which the equirectangular image is generated
  30. * When passing this, size and position arguments are ignored
  31. */
  32. probe?: ReflectionProbe;
  33. }
  34. /**
  35. * @param scene This refers to the scene which would be rendered in the given equirectangular capture
  36. * @param options This refers to the options for a given equirectangular capture
  37. * @returns the requested capture's pixel-data or auto downloads the file if options.filename is specified
  38. */
  39. export declare function captureEquirectangularFromScene(scene: Scene, options: EquiRectangularCaptureOptions): Promise<ArrayBufferView | null>;