Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

  • Constructor of the SSR rendering pipeline

    Parameters

    • name: string

      The rendering pipeline name

    • scene: Scene

      The scene linked to this pipeline

    • Optional cameras: Camera[]

      The array of cameras that the rendering pipeline will be attached to (default: scene.cameras)

    • Optional forceGeometryBuffer: boolean

      Set to true if you want to use the legacy geometry buffer renderer (default: false)

    • Optional textureType: number

      The texture type used by the different post processes created by SSR (default: Constants.TEXTURETYPE_UNSIGNED_BYTE)

    Returns SSRRenderingPipeline

Properties

SSRBlurRenderEffect: string

The blur PostProcess effect id in the pipeline

SSRCombineRenderEffect: string

The PostProcess effect id in the pipeline that combines the SSR-Blur output with the original scene color

SSRRenderEffect: string

The SSR PostProcess effect id in the pipeline

inspectableCustomProperties: IInspectable[]

List of inspectable custom properties (used by the Inspector)

see

https://doc.babylonjs.com/toolsAndResources/inspector#extensibility

maxDistance: number

Gets or sets the maxDistance used to define how far we look for reflection during the ray-marching on the reflected ray (default: 1000). Note that this value is a view (camera) space distance (not pixels!).

maxSteps: number

Maximum number of steps during the ray marching process after which we consider an intersection could not be found (default: 1000). Should be an integer value.

reflectionSpecularFalloffExponent: number

Gets or sets the falloff exponent used to compute the reflection strength. Higher values lead to fainter reflections (default: 1).

roughnessFactor: number

Gets or sets the factor applied when computing roughness. Default value is 0.2. When blurring based on roughness is enabled (meaning blurDispersionStrength > 0), roughnessFactor is used as a global roughness factor applied on all objects. If you want to disable this global roughness set it to 0.

selfCollisionNumSkip: number

Number of steps to skip at start when marching the ray to avoid self collisions (default: 1) 1 should normally be a good value, depending on the scene you may need to use a higher value (2 or 3)

step: number

Gets or sets the step size used to iterate until the effect finds the color of the reflection's pixel. Should be an integer >= 1 as it is the number of pixels we advance at each step (default: 1). Use higher values to improve performances (but at the expense of quality).

strength: number

Gets or sets the current reflection strength. 1.0 is an ideal value but can be increased/decreased for particular results (default: 1).

thickness: number

Gets or sets the thickness value used as tolerance when computing the intersection between the reflected ray and the scene (default: 0.5). If setting "enableAutomaticThicknessComputation" to true, you can use lower values for "thickness" (even 0), as the geometry thickness is automatically computed thank to the regular depth buffer + the backface depth buffer

Accessors

  • get attenuateBackfaceReflection(): boolean
  • set attenuateBackfaceReflection(attenuate: boolean): void
  • Gets or sets a boolean indicating if the backface reflections should be attenuated (default: false).

    Returns boolean

  • Gets or sets a boolean indicating if the backface reflections should be attenuated (default: false).

    Parameters

    • attenuate: boolean

    Returns void

  • get attenuateFacingCamera(): boolean
  • set attenuateFacingCamera(attenuate: boolean): void
  • Gets or sets a boolean indicating if the reflections should be attenuated when the reflection ray is facing the camera (the view direction) (default: false).

    Returns boolean

  • Gets or sets a boolean indicating if the reflections should be attenuated when the reflection ray is facing the camera (the view direction) (default: false).

    Parameters

    • attenuate: boolean

    Returns void

  • get attenuateIntersectionDistance(): boolean
  • set attenuateIntersectionDistance(attenuate: boolean): void
  • Gets or sets a boolean indicating if the reflections should be attenuated according to the distance of the intersection (default: true).

    Returns boolean

  • Gets or sets a boolean indicating if the reflections should be attenuated according to the distance of the intersection (default: true).

    Parameters

    • attenuate: boolean

    Returns void

  • get attenuateIntersectionIterations(): boolean
  • set attenuateIntersectionIterations(attenuate: boolean): void
  • Gets or sets a boolean indicating if the reflections should be attenuated according to the number of iterations performed to find the intersection (default: true).

    Returns boolean

  • Gets or sets a boolean indicating if the reflections should be attenuated according to the number of iterations performed to find the intersection (default: true).

    Parameters

    • attenuate: boolean

    Returns void

  • get attenuateScreenBorders(): boolean
  • set attenuateScreenBorders(attenuate: boolean): void
  • Gets or sets a boolean indicating if the reflections should be attenuated at the screen borders (default: true).

    Returns boolean

  • Gets or sets a boolean indicating if the reflections should be attenuated at the screen borders (default: true).

    Parameters

    • attenuate: boolean

    Returns void

  • Gets the depth renderer used to render the back faces of the scene to a depth texture.

    Returns Nullable<DepthRenderer>

  • get backfaceDepthTextureDownsample(): number
  • set backfaceDepthTextureDownsample(factor: number): void
  • Gets or sets the downsample factor (default: 0) used to create the backface depth texture - used only if enableAutomaticThicknessComputation = true. Use 0 to render the depth at full resolution, 1 to render at half resolution, 2 to render at 1/4 resolution, etc. Note that you will get rendering artefacts when using a value different from 0: it's a tradeoff between image quality and performances.

    Returns number

  • Gets or sets the downsample factor (default: 0) used to create the backface depth texture - used only if enableAutomaticThicknessComputation = true. Use 0 to render the depth at full resolution, 1 to render at half resolution, 2 to render at 1/4 resolution, etc. Note that you will get rendering artefacts when using a value different from 0: it's a tradeoff between image quality and performances.

    Parameters

    • factor: number

    Returns void

  • get backfaceForceDepthWriteTransparentMeshes(): boolean
  • set backfaceForceDepthWriteTransparentMeshes(force: boolean): void
  • Gets or sets a boolean (default: true) indicating if the depth of transparent meshes should be written to the backface depth texture (when automatic thickness computation is enabled).

    Returns boolean

  • Gets or sets a boolean (default: true) indicating if the depth of transparent meshes should be written to the backface depth texture (when automatic thickness computation is enabled).

    Parameters

    • force: boolean

    Returns void

  • get blurDispersionStrength(): number
  • set blurDispersionStrength(strength: number): void
  • Gets or sets the blur dispersion strength. Set this value to 0 to disable blurring (default: 0.05) The reflections are blurred based on the roughness of the surface and the distance between the pixel shaded and the reflected pixel: the higher the distance the more blurry the reflection is. blurDispersionStrength allows to increase or decrease this effect.

    Returns number

  • Gets or sets the blur dispersion strength. Set this value to 0 to disable blurring (default: 0.05) The reflections are blurred based on the roughness of the surface and the distance between the pixel shaded and the reflected pixel: the higher the distance the more blurry the reflection is. blurDispersionStrength allows to increase or decrease this effect.

    Parameters

    • strength: number

    Returns void

  • get blurDownsample(): number
  • set blurDownsample(downsample: number): void
  • Gets or sets the downsample factor used to reduce the size of the textures used to blur the reflection effect (default: 0). Use 0 to blur at full resolution, 1 to render at half resolution, 2 to render at 1/3 resolution, etc.

    Returns number

  • Gets or sets the downsample factor used to reduce the size of the textures used to blur the reflection effect (default: 0). Use 0 to blur at full resolution, 1 to render at half resolution, 2 to render at 1/3 resolution, etc.

    Parameters

    • downsample: number

    Returns void

  • Gets the list of attached cameras

    Returns Camera[]

  • get clipToFrustum(): boolean
  • set clipToFrustum(clip: boolean): void
  • Gets or sets a boolean indicating if the ray should be clipped to the frustum (default: true). You can try to set this parameter to false to save some performances: it may produce some artefacts in some cases, but generally they won't really be visible

    Returns boolean

  • Gets or sets a boolean indicating if the ray should be clipped to the frustum (default: true). You can try to set this parameter to false to save some performances: it may produce some artefacts in some cases, but generally they won't really be visible

    Parameters

    • clip: boolean

    Returns void

  • get debug(): boolean
  • set debug(value: boolean): void
  • Gets or sets a boolean indicating if the effect should be rendered in debug mode (default: false). In this mode, colors have this meaning:

    • blue: the ray hit the max distance (we reached maxDistance)
    • red: the ray ran out of steps (we reached maxSteps)
    • yellow: the ray went off screen
    • green: the ray hit a surface. The brightness of the green color is proportional to the distance between the ray origin and the intersection point: A brighter green means more computation than a darker green. In the first 3 cases, the final color is calculated by mixing the skybox color with the pixel color (if environmentTexture is defined), otherwise the pixel color is not modified You should try to get as few blue/red/yellow pixels as possible, as this means that the ray has gone further than if it had hit a surface.

    Returns boolean

  • Gets or sets a boolean indicating if the effect should be rendered in debug mode (default: false). In this mode, colors have this meaning:

    • blue: the ray hit the max distance (we reached maxDistance)
    • red: the ray ran out of steps (we reached maxSteps)
    • yellow: the ray went off screen
    • green: the ray hit a surface. The brightness of the green color is proportional to the distance between the ray origin and the intersection point: A brighter green means more computation than a darker green. In the first 3 cases, the final color is calculated by mixing the skybox color with the pixel color (if environmentTexture is defined), otherwise the pixel color is not modified You should try to get as few blue/red/yellow pixels as possible, as this means that the ray has gone further than if it had hit a surface.

    Parameters

    • value: boolean

    Returns void

  • get enableAutomaticThicknessComputation(): boolean
  • set enableAutomaticThicknessComputation(automatic: boolean): void
  • Gets or sets a boolean defining if geometry thickness should be computed automatically (default: false). When enabled, a depth renderer is created which will render the back faces of the scene to a depth texture (meaning additional work for the GPU). In that mode, the "thickness" property is still used as an offset to compute the ray intersection, but you can typically use a much lower value than when enableAutomaticThicknessComputation is false (it's even possible to use a value of 0 when using low values for "step") Note that for performance reasons, this option will only apply to the first camera to which the the rendering pipeline is attached!

    Returns boolean

  • Gets or sets a boolean defining if geometry thickness should be computed automatically (default: false). When enabled, a depth renderer is created which will render the back faces of the scene to a depth texture (meaning additional work for the GPU). In that mode, the "thickness" property is still used as an offset to compute the ray intersection, but you can typically use a much lower value than when enableAutomaticThicknessComputation is false (it's even possible to use a value of 0 when using low values for "step") Note that for performance reasons, this option will only apply to the first camera to which the the rendering pipeline is attached!

    Parameters

    • automatic: boolean

    Returns void

  • get enableSmoothReflections(): boolean
  • set enableSmoothReflections(enabled: boolean): void
  • Gets or sets whether or not smoothing reflections is enabled (default: false) Enabling smoothing will require more GPU power. Note that this setting has no effect if step = 1: it's only used if step > 1.

    Returns boolean

  • Gets or sets whether or not smoothing reflections is enabled (default: false) Enabling smoothing will require more GPU power. Note that this setting has no effect if step = 1: it's only used if step > 1.

    Parameters

    • enabled: boolean

    Returns void

  • Gets or sets the environment cube texture used to define the reflection when the reflected rays of SSR leave the view space or when the maxDistance/maxSteps is reached.

    Returns Nullable<CubeTexture>

  • Gets or sets the environment cube texture used to define the reflection when the reflected rays of SSR leave the view space or when the maxDistance/maxSteps is reached.

    Parameters

    Returns void

  • get environmentTextureIsProbe(): boolean
  • set environmentTextureIsProbe(isProbe: boolean): void
  • Gets or sets the boolean defining if the environment texture is a standard cubemap (false) or a probe (true). Default value is false. Note: a probe cube texture is treated differently than an ordinary cube texture because the Y axis is reversed.

    Returns boolean

  • Gets or sets the boolean defining if the environment texture is a standard cubemap (false) or a probe (true). Default value is false. Note: a probe cube texture is treated differently than an ordinary cube texture because the Y axis is reversed.

    Parameters

    • isProbe: boolean

    Returns void

  • get generateOutputInGammaSpace(): boolean
  • set generateOutputInGammaSpace(gammaSpace: boolean): void
  • Gets or sets a boolean defining if the output color texture generated by the SSR pipeline should be in gamma space (default: true) If you have a post-process that comes after the SSR and that post-process needs the input to be in a linear space, you must disable generateOutputInGammaSpace

    Returns boolean

  • Gets or sets a boolean defining if the output color texture generated by the SSR pipeline should be in gamma space (default: true) If you have a post-process that comes after the SSR and that post-process needs the input to be in a linear space, you must disable generateOutputInGammaSpace

    Parameters

    • gammaSpace: boolean

    Returns void

  • get inputTextureColorIsInGammaSpace(): boolean
  • set inputTextureColorIsInGammaSpace(gammaSpace: boolean): void
  • Gets or sets a boolean defining if the input color texture is in gamma space (default: true) The SSR effect works in linear space, so if the input texture is in gamma space, we must convert the texture to linear space before applying the effect

    Returns boolean

  • Gets or sets a boolean defining if the input color texture is in gamma space (default: true) The SSR effect works in linear space, so if the input texture is in gamma space, we must convert the texture to linear space before applying the effect

    Parameters

    • gammaSpace: boolean

    Returns void

  • get isEnabled(): boolean
  • set isEnabled(value: boolean): void
  • Gets or sets a boolean indicating if the effect is enabled (default: true).

    Returns boolean

  • Gets or sets a boolean indicating if the effect is enabled (default: true).

    Parameters

    • value: boolean

    Returns void

  • get isSupported(): boolean
  • Returns true if SSR is supported by the running hardware

    Returns boolean

  • get name(): string
  • Gets pipeline name

    Returns string

  • get reflectivityThreshold(): number
  • set reflectivityThreshold(threshold: number): void
  • Gets or sets the minimum value for one of the reflectivity component of the material to consider it for SSR (default: 0.04). If all r/g/b components of the reflectivity is below or equal this value, the pixel will not be considered reflective and SSR won't be applied.

    Returns number

  • Gets or sets the minimum value for one of the reflectivity component of the material to consider it for SSR (default: 0.04). If all r/g/b components of the reflectivity is below or equal this value, the pixel will not be considered reflective and SSR won't be applied.

    Parameters

    • threshold: number

    Returns void

  • get samples(): number
  • set samples(sampleCount: number): void
  • MSAA sample count, setting this to 4 will provide 4x anti aliasing. (default: 1)

    Returns number

  • MSAA sample count, setting this to 4 will provide 4x anti aliasing. (default: 1)

    Parameters

    • sampleCount: number

    Returns void

  • Gets active scene

    Returns Scene

  • get ssrDownsample(): number
  • set ssrDownsample(downsample: number): void
  • Gets or sets the downsample factor used to reduce the size of the texture used to compute the SSR contribution (default: 0). Use 0 to render the SSR contribution at full resolution, 1 to render at half resolution, 2 to render at 1/3 resolution, etc. Note that it is used only when blurring is enabled (blurDispersionStrength > 0), because in that mode the SSR contribution is generated in a separate texture.

    Returns number

  • Gets or sets the downsample factor used to reduce the size of the texture used to compute the SSR contribution (default: 0). Use 0 to render the SSR contribution at full resolution, 1 to render at half resolution, 2 to render at 1/3 resolution, etc. Note that it is used only when blurring is enabled (blurDispersionStrength > 0), because in that mode the SSR contribution is generated in a separate texture.

    Parameters

    • downsample: number

    Returns void

  • get useFresnel(): boolean
  • set useFresnel(fresnel: boolean): void
  • Gets or sets a boolean indicating whether the blending between the current color pixel and the reflection color should be done with a Fresnel coefficient (default: false). It is more physically accurate to use the Fresnel coefficient (otherwise it uses the reflectivity of the material for blending), but it is also more expensive when you use blur (when blurDispersionStrength > 0).

    Returns boolean

  • Gets or sets a boolean indicating whether the blending between the current color pixel and the reflection color should be done with a Fresnel coefficient (default: false). It is more physically accurate to use the Fresnel coefficient (otherwise it uses the reflectivity of the material for blending), but it is also more expensive when you use blur (when blurDispersionStrength > 0).

    Parameters

    • fresnel: boolean

    Returns void

Methods

  • addCamera(camera: Camera): void
  • Adds a camera to the pipeline

    Parameters

    • camera: Camera

      the camera to be added

    Returns void

  • dispose(disableGeometryBufferRenderer?: boolean): void
  • Removes the internal pipeline assets and detaches the pipeline from the scene cameras

    Parameters

    • Optional disableGeometryBufferRenderer: boolean

    Returns void

  • getClassName(): string
  • Gets the scene the effect belongs to.

    Returns Scene

    the scene the effect belongs to.

  • removeCamera(camera: Camera): void
  • Removes a camera from the pipeline

    Parameters

    • camera: Camera

      the camera to remove

    Returns void

  • serialize(): any
  • Serializes the rendering pipeline (Used when exporting)

    Returns any

    the serialized object

  • Parse the serialized pipeline

    Parameters

    • source: any

      Source pipeline.

    • scene: Scene

      The scene to load the pipeline to.

    • rootUrl: string

      The URL of the serialized pipeline.

    Returns SSRRenderingPipeline

    An instantiated pipeline from the serialized object.

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Property
  • Method
  • Static method

Settings

Theme