chromaticAberrationPostProcess.d.ts 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import { Vector2 } from "../Maths/math.vector";
  2. import type { Nullable } from "../types";
  3. import type { PostProcessOptions } from "./postProcess";
  4. import { PostProcess } from "./postProcess";
  5. import type { Camera } from "../Cameras/camera";
  6. import type { AbstractEngine } from "../Engines/abstractEngine";
  7. import "../Shaders/chromaticAberration.fragment";
  8. import type { Scene } from "../scene";
  9. /**
  10. * The ChromaticAberrationPostProcess separates the rgb channels in an image to produce chromatic distortion around the edges of the screen
  11. */
  12. export declare class ChromaticAberrationPostProcess extends PostProcess {
  13. /**
  14. * The amount of separation of rgb channels (default: 30)
  15. */
  16. aberrationAmount: number;
  17. /**
  18. * The amount the effect will increase for pixels closer to the edge of the screen. (default: 0)
  19. */
  20. radialIntensity: number;
  21. /**
  22. * The normalized direction in which the rgb channels should be separated. If set to 0,0 radial direction will be used. (default: Vector2(0.707,0.707))
  23. */
  24. direction: Vector2;
  25. /**
  26. * The center position where the radialIntensity should be around. [0.5,0.5 is center of screen, 1,1 is top right corner] (default: Vector2(0.5 ,0.5))
  27. */
  28. centerPosition: Vector2;
  29. /** The width of the screen to apply the effect on */
  30. screenWidth: number;
  31. /** The height of the screen to apply the effect on */
  32. screenHeight: number;
  33. /**
  34. * Gets a string identifying the name of the class
  35. * @returns "ChromaticAberrationPostProcess" string
  36. */
  37. getClassName(): string;
  38. /**
  39. * Creates a new instance ChromaticAberrationPostProcess
  40. * @param name The name of the effect.
  41. * @param screenWidth The width of the screen to apply the effect on.
  42. * @param screenHeight The height of the screen to apply the effect on.
  43. * @param options The required width/height ratio to downsize to before computing the render pass.
  44. * @param camera The camera to apply the render pass to.
  45. * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
  46. * @param engine The engine which the post process will be applied. (default: current engine)
  47. * @param reusable If the post process can be reused on the same frame. (default: false)
  48. * @param textureType Type of textures used when performing the post process. (default: 0)
  49. * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
  50. */
  51. constructor(name: string, screenWidth: number, screenHeight: number, options: number | PostProcessOptions, camera: Nullable<Camera>, samplingMode?: number, engine?: AbstractEngine, reusable?: boolean, textureType?: number, blockCompilation?: boolean);
  52. /**
  53. * @internal
  54. */
  55. static _Parse(parsedPostProcess: any, targetCamera: Camera, scene: Scene, rootUrl: string): Nullable<ChromaticAberrationPostProcess>;
  56. }