Skip to main content

PostProcessEffects

Contains static methods that return new instances of post-process effects.

Index

Constructors

constructor

Methods

publicstaticcreateDitherBlur

  • createDitherBlur(kernel?: number): DitherBlurPipeline
  • Creates a new instance of the Dither Blur post-process effect. This is used to blur pixels masked as being dithered (which is only opaque objects with alpha < 1.0)


    Parameters

    • kernel: number = 16.0

      The size of the kernel to be used when computing the blur. Defaults to 16 if no value is provided. It does not correspond exactly to the number of fragments sampled but still raising this number will decrease performance

    Returns DitherBlurPipeline

    The newly created instance.

publicstaticcreateLineShading

  • createLineShading(lineThickness?: number, normalsSensitive?: boolean): BaseLineShading
  • Creates a new instance of the LineShading post-process effect, or if normalsSensitive === true, NormalsFromDepthLineShading.


    Parameters

    • lineThickness: number = 0.3

      Thickness of the lines, a value between 0 and 1.

    • normalsSensitive: boolean = true

    Returns BaseLineShading

    The newly created instance.

publicstaticcreateSSAOPipeline

  • createSSAOPipeline(samplesCount?: number, strength?: number, blurSize?: number, radius?: number, renderScale?: number): SSAOPipeline
  • Creates a new instance of the SSAO pipeline post-process effect


    Parameters

    • optionalsamplesCount: number

      Number of SSAO samples per frame, higher gives better SSAO quality but reduces performance and the other way around, default is 46, has to be whole numbers

    • optionalstrength: number

      Strength of SSAO, higher value means larger impact of SSAO, default is 1.0

    • optionalblurSize: number

      How many pixels of the SSAO result that is blurred, has to be a whole number, default is 16

    • optionalradius: number

      How spaced out the SSAO samples are, default is 0.08

    • optionalrenderScale: number

      The resolution at which the SSAO is calculated, reducing this below 1.0 means that the SSAO calculations are made at a lower scale and then scaled back again to fit the current render frame. This means that it will use less GPU resources, but also that it will look blurry. Default is 1.0, recommended values are 1.0, 0.5 and 0.25

    Returns SSAOPipeline

    The newly created instance of the ssao pipeline