bloomEffect.d.ts 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import { PostProcessRenderEffect } from "../PostProcesses/RenderPipeline/postProcessRenderEffect";
  2. import type { PostProcess } from "./postProcess";
  3. import { ExtractHighlightsPostProcess } from "./extractHighlightsPostProcess";
  4. import type { Camera } from "../Cameras/camera";
  5. import type { Scene } from "../scene";
  6. /**
  7. * The bloom effect spreads bright areas of an image to simulate artifacts seen in cameras
  8. */
  9. export declare class BloomEffect extends PostProcessRenderEffect {
  10. private _bloomScale;
  11. /**
  12. * @internal Internal
  13. */
  14. _effects: Array<PostProcess>;
  15. /**
  16. * @internal Internal
  17. */
  18. _downscale: ExtractHighlightsPostProcess;
  19. private _blurX;
  20. private _blurY;
  21. private _merge;
  22. /**
  23. * The luminance threshold to find bright areas of the image to bloom.
  24. */
  25. get threshold(): number;
  26. set threshold(value: number);
  27. /**
  28. * The strength of the bloom.
  29. */
  30. get weight(): number;
  31. set weight(value: number);
  32. /**
  33. * Specifies the size of the bloom blur kernel, relative to the final output size
  34. */
  35. get kernel(): number;
  36. set kernel(value: number);
  37. /**
  38. * Creates a new instance of @see BloomEffect
  39. * @param scene The scene the effect belongs to.
  40. * @param _bloomScale The ratio of the blur texture to the input texture that should be used to compute the bloom.
  41. * @param bloomWeight The strength of bloom.
  42. * @param bloomKernel The size of the kernel to be used when applying the blur.
  43. * @param pipelineTextureType The type of texture to be used when performing the post processing.
  44. * @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)
  45. */
  46. constructor(scene: Scene, _bloomScale: number, bloomWeight: number, bloomKernel: number, pipelineTextureType?: number, blockCompilation?: boolean);
  47. /**
  48. * Disposes each of the internal effects for a given camera.
  49. * @param camera The camera to dispose the effect on.
  50. */
  51. disposeEffects(camera: Camera): void;
  52. /**
  53. * @internal Internal
  54. */
  55. _updateEffects(): void;
  56. /**
  57. * Internal
  58. * @returns if all the contained post processes are ready.
  59. * @internal
  60. */
  61. _isReady(): boolean;
  62. }