LensRenderingPipeline

BABYLON.JS Chromatic Aberration GLSL Shader Author: Olivier Guyot Separates very slightly R, G and B colors on the edges of the screen Inspired by Francois Tarlier & Martins Upitis

Hierarchy

Index

Constructors

constructor

Find examples in Playground
  • constructor

    Effect parameters are as follow: { chromatic_aberration: number; // from 0 to x (1 for realism) edge_blur: number; // from 0 to x (1 for realism) distortion: number; // from 0 to x (1 for realism) grain_amount: number; // from 0 to 1 grain_texture: BABYLON.Texture; // texture to use for grain effect; if unset, use random B&W noise dof_focus_distance: number; // depth-of-field: focus distance; unset to disable (disabled by default) dof_aperture: number; // depth-of-field: focus blur bias (default: 1) dof_darken: number; // depth-of-field: darken that which is out of focus (from 0 to 1, disabled by default) dof_pentagon: boolean; // depth-of-field: makes a pentagon-like "bokeh" effect dof_gain: number; // depth-of-field: highlights gain; unset to disable (disabled by default) dof_threshold: number; // depth-of-field: highlights threshold (default: 1) blur_noise: boolean; // add a little bit of noise to the blur (default: true) } Note: if an effect parameter is unset, effect is disabled

    Parameters

    • name: string

      The rendering pipeline name

    • parameters: any

      An object containing all parameters (see above)

    • scene: Scene

      The scene linked to this pipeline

    • Optional ratio: number

      The size of the postprocesses (0.5 means that your postprocess will have a width = canvas.width 0.5 and a height = canvas.height 0.5)

    • Optional cameras: Camera[]

      The array of cameras that the rendering pipeline will be attached to

    Returns LensRenderingPipeline

Properties

inspectableCustomProperties

Find examples in Playground
inspectableCustomProperties: IInspectable[]

List of inspectable custom properties (used by the Inspector)

see

https://doc.babylonjs.com/how_to/debug_layer#extensibility

Accessors

blurNoise

Find examples in Playground
  • get blurNoise(): boolean
  • set blurNoise(value: boolean): any
  • Gets or sets a boolean indicating if blur noise is enabled

    Returns boolean

  • Gets or sets a boolean indicating if blur noise is enabled

    Parameters

    • value: boolean

    Returns any

cameras

Find examples in Playground

chromaticAberration

Find examples in Playground
  • get chromaticAberration(): number
  • set chromaticAberration(value: number): any
  • Gets or sets the chromatic aberration amount

    Returns number

  • Gets or sets the chromatic aberration amount

    Parameters

    • value: number

    Returns any

darkenOutOfFocus

Find examples in Playground
  • get darkenOutOfFocus(): number
  • set darkenOutOfFocus(value: number): any
  • Gets or sets the darken out of focus amount

    Returns number

  • Gets or sets the darken out of focus amount

    Parameters

    • value: number

    Returns any

dofAperture

Find examples in Playground
  • get dofAperture(): number
  • set dofAperture(value: number): any
  • Gets or sets the depth of field aperture

    Returns number

  • Gets or sets the depth of field aperture

    Parameters

    • value: number

    Returns any

dofDistortion

Find examples in Playground
  • get dofDistortion(): number
  • set dofDistortion(value: number): any
  • Gets or sets the depth of field distortion

    Returns number

  • Gets or sets the depth of field distortion

    Parameters

    • value: number

    Returns any

edgeBlur

Find examples in Playground
  • get edgeBlur(): number
  • set edgeBlur(value: number): any
  • Gets or sets the edge blur

    Returns number

  • Gets or sets the edge blur

    Parameters

    • value: number

    Returns any

edgeDistortion

Find examples in Playground
  • get edgeDistortion(): number
  • set edgeDistortion(value: number): any
  • Gets or sets the edge distortion

    Returns number

  • Gets or sets the edge distortion

    Parameters

    • value: number

    Returns any

grainAmount

Find examples in Playground
  • get grainAmount(): number
  • set grainAmount(value: number): any
  • Gets or sets the grain amount

    Returns number

  • Gets or sets the grain amount

    Parameters

    • value: number

    Returns any

highlightsGain

Find examples in Playground
  • get highlightsGain(): number
  • set highlightsGain(value: number): any
  • Gets or sets the highlight grain amount

    Returns number

  • Gets or sets the highlight grain amount

    Parameters

    • value: number

    Returns any

highlightsThreshold

Find examples in Playground
  • get highlightsThreshold(): number
  • set highlightsThreshold(value: number): any
  • Gets or sets the highlight threshold

    Returns number

  • Gets or sets the highlight threshold

    Parameters

    • value: number

    Returns any

isSupported

Find examples in Playground
  • get isSupported(): boolean

name

Find examples in Playground
  • get name(): string

pentagonBokeh

Find examples in Playground
  • get pentagonBokeh(): boolean
  • set pentagonBokeh(value: boolean): any
  • Gets or sets a boolean indicating if pentagon bokeh is enabled

    Returns boolean

  • Gets or sets a boolean indicating if pentagon bokeh is enabled

    Parameters

    • value: boolean

    Returns any

scene

Find examples in Playground
  • Gets associated scene

    Returns Scene

Methods

addEffect

Find examples in Playground

disableChromaticAberration

Find examples in Playground
  • disableChromaticAberration(): void
  • Sets chromatic aberration amount to 0

    Returns void

disableDepthOfField

Find examples in Playground
  • disableDepthOfField(): void
  • Disables depth of field

    Returns void

disableEdgeBlur

Find examples in Playground
  • disableEdgeBlur(): void
  • Sets edge blur to 0

    Returns void

disableEdgeDistortion

Find examples in Playground
  • disableEdgeDistortion(): void
  • Sets edge distortion to 0

    Returns void

disableGrain

Find examples in Playground
  • disableGrain(): void
  • Set grain amount to 0

    Returns void

disableHighlights

Find examples in Playground
  • disableHighlights(): void
  • Disables highlights

    Returns void

disableNoiseBlur

Find examples in Playground
  • disableNoiseBlur(): void
  • Disables noise blur

    Returns void

disablePentagonBokeh

Find examples in Playground
  • disablePentagonBokeh(): void
  • Disables the pentagon bokeh effect

    Returns void

dispose

Find examples in Playground
  • dispose(disableDepthRender?: boolean): void
  • Removes the internal pipeline assets and detaches the pipeline from the scene cameras

    Parameters

    • Optional disableDepthRender: boolean

      If the scens depth rendering should be disabled (default: false)

    Returns void

enableNoiseBlur

Find examples in Playground
  • enableNoiseBlur(): void
  • Enables noise blur

    Returns void

enablePentagonBokeh

Find examples in Playground
  • enablePentagonBokeh(): void
  • Creates a pentagon bokeh effect

    Returns void

getClassName

Find examples in Playground
  • getClassName(): string

setAperture

Find examples in Playground
  • setAperture(amount: number): void
  • Sets the Aperture amount

    Parameters

    • amount: number

      amount of Aperture

    Returns void

setChromaticAberration

Find examples in Playground
  • setChromaticAberration(amount: number): void
  • Sets the chromatic aberration amount

    Parameters

    • amount: number

      amount of chromatic aberration

    Returns void

setDarkenOutOfFocus

Find examples in Playground
  • setDarkenOutOfFocus(amount: number): void
  • Sets the DarkenOutOfFocus amount

    Parameters

    • amount: number

      amount of DarkenOutOfFocus

    Returns void

setEdgeBlur

Find examples in Playground
  • setEdgeBlur(amount: number): void
  • Sets the amount of blur at the edges

    Parameters

    • amount: number

      blur amount

    Returns void

setEdgeDistortion

Find examples in Playground
  • setEdgeDistortion(amount: number): void
  • Sets the EdgeDistortion amount

    Parameters

    • amount: number

      amount of EdgeDistortion

    Returns void

setFocusDistance

Find examples in Playground
  • setFocusDistance(amount: number): void
  • Sets the FocusDistance amount

    Parameters

    • amount: number

      amount of FocusDistance

    Returns void

setGrainAmount

Find examples in Playground
  • setGrainAmount(amount: number): void
  • Sets the amout of grain

    Parameters

    • amount: number

      Amount of grain

    Returns void

setHighlightsGain

Find examples in Playground
  • setHighlightsGain(amount: number): void
  • Sets the HighlightsGain amount

    Parameters

    • amount: number

      amount of HighlightsGain

    Returns void

setHighlightsThreshold

Find examples in Playground
  • setHighlightsThreshold(amount: number): void
  • Sets the HighlightsThreshold amount

    Parameters

    • amount: number

      amount of HighlightsThreshold

    Returns void

Generated using TypeDoc