screenSpaceReflectionPostProcess.d.ts 4.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. import type { Nullable } from "../types";
  2. import type { Camera } from "../Cameras/camera";
  3. import type { PostProcessOptions } from "./postProcess";
  4. import { PostProcess } from "./postProcess";
  5. import "../Shaders/screenSpaceReflection.fragment";
  6. import type { AbstractEngine } from "../Engines/abstractEngine";
  7. import type { Scene } from "../scene";
  8. /**
  9. * The ScreenSpaceReflectionPostProcess performs realtime reflections using only and only the available informations on the screen (positions and normals).
  10. * Basically, the screen space reflection post-process will compute reflections according the material's reflectivity.
  11. * @deprecated Use the new SSRRenderingPipeline instead.
  12. */
  13. export declare class ScreenSpaceReflectionPostProcess extends PostProcess {
  14. /**
  15. * Gets or sets a reflection threshold mainly used to adjust the reflection's height.
  16. */
  17. threshold: number;
  18. /**
  19. * Gets or sets the current reflection strength. 1.0 is an ideal value but can be increased/decreased for particular results.
  20. */
  21. strength: number;
  22. /**
  23. * Gets or sets the falloff exponent used while computing fresnel. More the exponent is high, more the reflections will be discrete.
  24. */
  25. reflectionSpecularFalloffExponent: number;
  26. /**
  27. * Gets or sets the step size used to iterate until the effect finds the color of the reflection's pixel. Typically in interval [0.1, 1.0]
  28. */
  29. step: number;
  30. /**
  31. * Gets or sets the factor applied when computing roughness. Default value is 0.2.
  32. */
  33. roughnessFactor: number;
  34. private _forceGeometryBuffer;
  35. private get _geometryBufferRenderer();
  36. private get _prePassRenderer();
  37. private _enableSmoothReflections;
  38. private _reflectionSamples;
  39. private _smoothSteps;
  40. private _isSceneRightHanded;
  41. /**
  42. * Gets a string identifying the name of the class
  43. * @returns "ScreenSpaceReflectionPostProcess" string
  44. */
  45. getClassName(): string;
  46. /**
  47. * Creates a new instance of ScreenSpaceReflectionPostProcess.
  48. * @param name The name of the effect.
  49. * @param scene The scene containing the objects to calculate reflections.
  50. * @param options The required width/height ratio to downsize to before computing the render pass.
  51. * @param camera The camera to apply the render pass to.
  52. * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
  53. * @param engine The engine which the post process will be applied. (default: current engine)
  54. * @param reusable If the post process can be reused on the same frame. (default: false)
  55. * @param textureType Type of textures used when performing the post process. (default: 0)
  56. * @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: true)
  57. * @param forceGeometryBuffer If this post process should use geometry buffer instead of prepass (default: false)
  58. */
  59. constructor(name: string, scene: Scene, options: number | PostProcessOptions, camera: Nullable<Camera>, samplingMode?: number, engine?: AbstractEngine, reusable?: boolean, textureType?: number, blockCompilation?: boolean, forceGeometryBuffer?: boolean);
  60. /**
  61. * Gets whether or not smoothing reflections is enabled.
  62. * Enabling smoothing will require more GPU power and can generate a drop in FPS.
  63. */
  64. get enableSmoothReflections(): boolean;
  65. /**
  66. * Sets whether or not smoothing reflections is enabled.
  67. * Enabling smoothing will require more GPU power and can generate a drop in FPS.
  68. */
  69. set enableSmoothReflections(enabled: boolean);
  70. /**
  71. * Gets the number of samples taken while computing reflections. More samples count is high,
  72. * more the post-process wil require GPU power and can generate a drop in FPS. Basically in interval [25, 100].
  73. */
  74. get reflectionSamples(): number;
  75. /**
  76. * Sets the number of samples taken while computing reflections. More samples count is high,
  77. * more the post-process wil require GPU power and can generate a drop in FPS. Basically in interval [25, 100].
  78. */
  79. set reflectionSamples(samples: number);
  80. /**
  81. * Gets the number of samples taken while smoothing reflections. More samples count is high,
  82. * more the post-process will require GPU power and can generate a drop in FPS.
  83. * Default value (5.0) work pretty well in all cases but can be adjusted.
  84. */
  85. get smoothSteps(): number;
  86. set smoothSteps(steps: number);
  87. private _updateEffectDefines;
  88. /**
  89. * @internal
  90. */
  91. static _Parse(parsedPostProcess: any, targetCamera: Camera, scene: Scene, rootUrl: string): ScreenSpaceReflectionPostProcess;
  92. }