displayPassPostProcess.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { PostProcess } from "./postProcess.js";
  2. import "../Shaders/displayPass.fragment.js";
  3. import { RegisterClass } from "../Misc/typeStore.js";
  4. import { SerializationHelper } from "../Misc/decorators.serialization.js";
  5. /**
  6. * DisplayPassPostProcess which produces an output the same as it's input
  7. */
  8. export class DisplayPassPostProcess extends PostProcess {
  9. /**
  10. * Gets a string identifying the name of the class
  11. * @returns "DisplayPassPostProcess" string
  12. */
  13. getClassName() {
  14. return "DisplayPassPostProcess";
  15. }
  16. /**
  17. * Creates the DisplayPassPostProcess
  18. * @param name The name of the effect.
  19. * @param options The required width/height ratio to downsize to before computing the render pass.
  20. * @param camera The camera to apply the render pass to.
  21. * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
  22. * @param engine The engine which the post process will be applied. (default: current engine)
  23. * @param reusable If the post process can be reused on the same frame. (default: false)
  24. */
  25. constructor(name, options, camera, samplingMode, engine, reusable) {
  26. super(name, "displayPass", ["passSampler"], ["passSampler"], options, camera, samplingMode, engine, reusable);
  27. }
  28. /**
  29. * @internal
  30. */
  31. static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {
  32. return SerializationHelper.Parse(() => {
  33. return new DisplayPassPostProcess(parsedPostProcess.name, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.reusable);
  34. }, parsedPostProcess, scene, rootUrl);
  35. }
  36. }
  37. RegisterClass("BABYLON.DisplayPassPostProcess", DisplayPassPostProcess);
  38. //# sourceMappingURL=displayPassPostProcess.js.map