refractionPostProcess.d.ts 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import type { Color3 } from "../Maths/math.color";
  2. import type { Camera } from "../Cameras/camera";
  3. import { Texture } from "../Materials/Textures/texture";
  4. import type { PostProcessOptions } from "./postProcess";
  5. import { PostProcess } from "./postProcess";
  6. import type { AbstractEngine } from "../Engines/abstractEngine";
  7. import "../Shaders/refraction.fragment";
  8. import type { Nullable } from "../types";
  9. import type { Scene } from "../scene";
  10. /**
  11. * Post process which applies a refraction texture
  12. * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses#refraction
  13. */
  14. export declare class RefractionPostProcess extends PostProcess {
  15. private _refTexture;
  16. private _ownRefractionTexture;
  17. /** the base color of the refraction (used to taint the rendering) */
  18. color: Color3;
  19. /** simulated refraction depth */
  20. depth: number;
  21. /** the coefficient of the base color (0 to remove base color tainting) */
  22. colorLevel: number;
  23. /** Gets the url used to load the refraction texture */
  24. refractionTextureUrl: string;
  25. /**
  26. * Gets or sets the refraction texture
  27. * Please note that you are responsible for disposing the texture if you set it manually
  28. */
  29. get refractionTexture(): Texture;
  30. set refractionTexture(value: Texture);
  31. /**
  32. * Gets a string identifying the name of the class
  33. * @returns "RefractionPostProcess" string
  34. */
  35. getClassName(): string;
  36. /**
  37. * Initializes the RefractionPostProcess
  38. * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses#refraction
  39. * @param name The name of the effect.
  40. * @param refractionTextureUrl Url of the refraction texture to use
  41. * @param color the base color of the refraction (used to taint the rendering)
  42. * @param depth simulated refraction depth
  43. * @param colorLevel the coefficient of the base color (0 to remove base color tainting)
  44. * @param options The required width/height ratio to downsize to before computing the render pass.
  45. * @param camera The camera to apply the render pass to.
  46. * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
  47. * @param engine The engine which the post process will be applied. (default: current engine)
  48. * @param reusable If the post process can be reused on the same frame. (default: false)
  49. */
  50. constructor(name: string, refractionTextureUrl: string, color: Color3, depth: number, colorLevel: number, options: number | PostProcessOptions, camera: Nullable<Camera>, samplingMode?: number, engine?: AbstractEngine, reusable?: boolean);
  51. /**
  52. * Disposes of the post process
  53. * @param camera Camera to dispose post process on
  54. */
  55. dispose(camera: Camera): void;
  56. /**
  57. * @internal
  58. */
  59. static _Parse(parsedPostProcess: any, targetCamera: Camera, scene: Scene, rootUrl: string): RefractionPostProcess;
  60. }