babylon.blackAndWhitePostProcess.ts 1.4 KB

123456789101112131415161718192021222324252627282930
  1. module BABYLON {
  2. /**
  3. * Post process used to render in black and white
  4. */
  5. export class BlackAndWhitePostProcess extends PostProcess {
  6. /**
  7. * Linear about to convert he result to black and white (default: 1)
  8. */
  9. public degree = 1;
  10. /**
  11. * Creates a black and white post process
  12. * @see https://doc.babylonjs.com/how_to/how_to_use_postprocesses#black-and-white
  13. * @param name The name of the effect.
  14. * @param options The required width/height ratio to downsize to before computing the render pass.
  15. * @param camera The camera to apply the render pass to.
  16. * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
  17. * @param engine The engine which the post process will be applied. (default: current engine)
  18. * @param reusable If the post process can be reused on the same frame. (default: false)
  19. */
  20. constructor(name: string, options: number | PostProcessOptions, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean) {
  21. super(name, "blackAndWhite", ["degree"], null, options, camera, samplingMode, engine, reusable);
  22. this.onApplyObservable.add((effect: Effect) => {
  23. effect.setFloat("degree", this.degree);
  24. });
  25. }
  26. }
  27. }