Define different types of rendering pipeline

interface RenderingPipelineConfig {
    defaultRenderingPipeline?: {
        enable?: boolean;
        fxaaEnabled?: boolean;
        imageProcessing?: {
            contrast?: number;
            enable?: boolean;
            exposure?: number;
            toneMappingEnabled?: boolean;
            toneMappingType?: 0 | 1 | 2;
        };
        samples?: number;
    };
    ssao2RenderingPipeline?: {
        blurRatio?: number;
        combineRatio?: number;
        enable?: boolean;
        expensiveBlur?: boolean;
        forceGeometryBuffer?: boolean;
        ratio?: number;
        samples?: number;
        ssaoRatio?: number;
        textureSamples?: number;
    };
}

Properties

defaultRenderingPipeline?: {
    enable?: boolean;
    fxaaEnabled?: boolean;
    imageProcessing?: {
        contrast?: number;
        enable?: boolean;
        exposure?: number;
        toneMappingEnabled?: boolean;
        toneMappingType?: 0 | 1 | 2;
    };
    samples?: number;
}

Default rendering pipeline configuration.

The default rendering pipeline can be added to a scene to apply common post-processing effects such as anti-aliasing or depth of field.

Type declaration

  • Optionalenable?: boolean

    Whether to enable the rendering pipeline

    true
    
  • OptionalfxaaEnabled?: boolean

    Fast Approximate Anti-aliasing (FXAA) uses a full screen pass that smooths edges on a per-pixel level.

    false
    
  • OptionalimageProcessing?: {
        contrast?: number;
        enable?: boolean;
        exposure?: number;
        toneMappingEnabled?: boolean;
        toneMappingType?: 0 | 1 | 2;
    }

    Image post-processing pass used to perform operations

    • Optionalcontrast?: number

      Contrast used in the effect

      1
      
    • Optionalenable?: boolean

      Whether to enable image post-processing

      true
      
    • Optionalexposure?: number

      Exposure used in the effect

      1
      
    • OptionaltoneMappingEnabled?: boolean

      Enable tone mapping

      false
      
    • OptionaltoneMappingType?: 0 | 1 | 2

      Tone mapping type 0: Standard 1: ACES 2: Khronos PBR Neutral

      0
      
  • Optionalsamples?: number

    MSAA sample count, setting this to 4 will provide 4x anti aliasing

    1
    
ssao2RenderingPipeline?: {
    blurRatio?: number;
    combineRatio?: number;
    enable?: boolean;
    expensiveBlur?: boolean;
    forceGeometryBuffer?: boolean;
    ratio?: number;
    samples?: number;
    ssaoRatio?: number;
    textureSamples?: number;
}

SSAO2 rendering pipeline configuration.

This rendering pipeline can be added to a scene to apply post-processing effects such as Squared Space Ambient Occlusion (SSAO). Note: only available with WebGL2.

Type declaration

  • OptionalblurRatio?: number

    A horizontal and vertical Gaussian shader blur to clear the noise. Note: all 3 ssaoRatio & blurRatio & combineRatio must be configured for this to apply.

    undefined
    
  • OptionalcombineRatio?: number

    Ratio of the combine post-process (combines the SSAO and the scene. Note: all 3 ssaoRatio & blurRatio & combineRatio must be configured for this to apply.

    undefined
    
  • Optionalenable?: boolean

    Whether to enable the rendering pipeline.

    false
    
  • OptionalexpensiveBlur?: boolean

    Enables the configurable bilateral de-noising (blurring) filter. Set false to instead use a legacy bilateral filter that can't be configured.

    true
    
  • OptionalforceGeometryBuffer?: boolean

    A legacy geometry buffer renderer.

    false
    
  • Optionalratio?: number

    The size of the post-processes is a number shared between passes or for more precision modify ssaoRatio, blurRatio, and combineRatio.

    0.5
    
  • Optionalsamples?: number

    Number of samples used for the SSAO calculations.

    1
    
  • OptionalssaoRatio?: number

    ratio of the SSAO post-process used. Is more specific than the generic ratio placeholder Note: all 3 ssaoRatio & blurRatio & combineRatio must be configured for this to apply.

    undefined
    
  • OptionaltextureSamples?: number

    Number of samples to use for antialiasing, setting this to 4 will provide 4x anti aliasing.

    1