Options
All
  • Public
  • Public/Protected
  • All
Menu

Class used to render an object as a fluid thanks to different render target textures (depth, thickness, diffuse)

Hierarchy

  • FluidRenderingTargetRenderer

Index

Constructors

  • Creates an instance of the class

    Parameters

    • scene: Scene

      Scene used to render the fluid object into

    • Optional camera: Camera

      Camera used to render the fluid object. If not provided, use the active camera of the scene instead

    Returns FluidRenderingTargetRenderer

Properties

density: number

Density of the fluid (positive number). The higher the value, the more opaque the fluid.

dirLight: Vector3

Direction of the light. The fluid is assumed to be lit by a directional light

fluidColor: Color3

Fluid color. Not used if generateDiffuseTexture is true

fresnelClamp: number

Strength of the fresnel effect (value between 0 and 1). Lower the value if you want to soften the specular effect

minimumThickness: number

Minimum thickness of the particles (positive number). If useFixedThickness is true, minimumThickness is the thickness used

refractionStrength: number

Strength of the refraction (positive number, but generally between 0 and 0.3).

specularPower: number

Strength of the specular power (positive number). Increase the value to make the specular effect more concentrated

Accessors

  • get blurDepthDepthScale(): number
  • set blurDepthDepthScale(scale: number): void
  • Depth weight in the calculation when applying the bilateral blur to generate the depth blur texture (positive number, generally between 0 and 100)

    Returns number

  • Depth weight in the calculation when applying the bilateral blur to generate the depth blur texture (positive number, generally between 0 and 100)

    Parameters

    • scale: number

    Returns void

  • get blurDepthFilterSize(): number
  • set blurDepthFilterSize(filterSize: number): void
  • Size of the kernel used to filter the depth blur texture (positive number, generally between 1 and 20 - higher values will require more processing power from the GPU)

    Returns number

  • Size of the kernel used to filter the depth blur texture (positive number, generally between 1 and 20 - higher values will require more processing power from the GPU)

    Parameters

    • filterSize: number

    Returns void

  • get blurDepthMaxFilterSize(): number
  • set blurDepthMaxFilterSize(maxFilterSize: number): void
  • Maximum size of the kernel used to blur the depth texture (positive number, generally between 1 and 200 - higher values will require more processing power from the GPU when the particles are larger on screen)

    Returns number

  • Maximum size of the kernel used to blur the depth texture (positive number, generally between 1 and 200 - higher values will require more processing power from the GPU when the particles are larger on screen)

    Parameters

    • maxFilterSize: number

    Returns void

  • get blurDepthNumIterations(): number
  • set blurDepthNumIterations(numIterations: number): void
  • Number of blurring iterations used to generate the depth blur texture (positive number, generally between 1 and 10 - higher values will require more processing power from the GPU)

    Returns number

  • Number of blurring iterations used to generate the depth blur texture (positive number, generally between 1 and 10 - higher values will require more processing power from the GPU)

    Parameters

    • numIterations: number

    Returns void

  • get blurDepthSizeDivisor(): number
  • set blurDepthSizeDivisor(scale: number): void
  • Gets or sets the depth size divisor (positive number, generally between 1 and 4), which is used as a divisor when creating the texture used for blurring the depth For eg. if blurDepthSizeDivisor=2, the texture used to blur the depth will be half the size of the depth texture

    Returns number

  • Gets or sets the depth size divisor (positive number, generally between 1 and 4), which is used as a divisor when creating the texture used for blurring the depth For eg. if blurDepthSizeDivisor=2, the texture used to blur the depth will be half the size of the depth texture

    Parameters

    • scale: number

    Returns void

  • get blurThicknessFilterSize(): number
  • set blurThicknessFilterSize(filterSize: number): void
  • Size of the kernel used to filter the thickness blur texture (positive number, generally between 1 and 20 - higher values will require more processing power from the GPU)

    Returns number

  • Size of the kernel used to filter the thickness blur texture (positive number, generally between 1 and 20 - higher values will require more processing power from the GPU)

    Parameters

    • filterSize: number

    Returns void

  • get blurThicknessNumIterations(): number
  • set blurThicknessNumIterations(numIterations: number): void
  • Number of blurring iterations used to generate the thickness blur texture (positive number, generally between 1 and 10 - higher values will require more processing power from the GPU)

    Returns number

  • Number of blurring iterations used to generate the thickness blur texture (positive number, generally between 1 and 10 - higher values will require more processing power from the GPU)

    Parameters

    • numIterations: number

    Returns void

  • get blurThicknessSizeDivisor(): number
  • set blurThicknessSizeDivisor(scale: number): void
  • Gets or sets the thickness size divisor (positive number, generally between 1 and 4), which is used as a divisor when creating the texture used for blurring the thickness For eg. if blurThicknessSizeDivisor=2, the texture used to blur the thickness will be half the size of the thickness texture

    Returns number

  • Gets or sets the thickness size divisor (positive number, generally between 1 and 4), which is used as a divisor when creating the texture used for blurring the thickness For eg. if blurThicknessSizeDivisor=2, the texture used to blur the thickness will be half the size of the thickness texture

    Parameters

    • scale: number

    Returns void

  • Gets the camera used for the rendering

    Returns Nullable<Camera>

  • get debug(): boolean
  • set debug(debug: boolean): void
  • Gets or sets a boolean indicating if we should display a specific texture (given by debugFeature) for debugging purpose

    Returns boolean

  • Gets or sets a boolean indicating if we should display a specific texture (given by debugFeature) for debugging purpose

    Parameters

    • debug: boolean

    Returns void

  • Gets or sets the feature (texture) to be debugged. Not used if debug is false

    Returns FluidRenderingDebug

  • Gets or sets the feature (texture) to be debugged. Not used if debug is false

    Parameters

    Returns void

  • get depthMapSize(): Nullable<number>
  • set depthMapSize(size: Nullable<number>): void
  • Defines the size of the depth texture. If null, the texture will have the size of the screen

    Returns Nullable<number>

  • Defines the size of the depth texture. If null, the texture will have the size of the screen

    Parameters

    Returns void

  • get diffuseMapSize(): Nullable<number>
  • set diffuseMapSize(size: Nullable<number>): void
  • Defines the size of the diffuse texture. If null, the texture will have the size of the screen

    Returns Nullable<number>

  • Defines the size of the diffuse texture. If null, the texture will have the size of the screen

    Parameters

    Returns void

  • get enableBlurDepth(): boolean
  • set enableBlurDepth(enable: boolean): void
  • Gets or sets a boolean indicating that the depth texture should be blurred

    Returns boolean

  • Gets or sets a boolean indicating that the depth texture should be blurred

    Parameters

    • enable: boolean

    Returns void

  • get enableBlurThickness(): boolean
  • set enableBlurThickness(enable: boolean): void
  • Gets or sets a boolean indicating that the thickness texture should be blurred

    Returns boolean

  • Gets or sets a boolean indicating that the thickness texture should be blurred

    Parameters

    • enable: boolean

    Returns void

  • Gets or sets the environment map used for the reflection part of the shading If null, no map will be used. If undefined, the scene.environmentMap will be used (if defined)

    Returns undefined | Nullable<BaseTexture>

  • Gets or sets the environment map used for the reflection part of the shading If null, no map will be used. If undefined, the scene.environmentMap will be used (if defined)

    Parameters

    Returns void

  • get generateDiffuseTexture(): boolean
  • set generateDiffuseTexture(generate: boolean): void
  • Gets or sets a boolean indicating that the diffuse texture should be generated and used for the rendering

    Returns boolean

  • Gets or sets a boolean indicating that the diffuse texture should be generated and used for the rendering

    Parameters

    • generate: boolean

    Returns void

  • get needInitialization(): boolean
  • Returns true if the class needs to be reinitialized (because of changes in parameterization)

    Returns boolean

  • get samples(): number
  • set samples(samples: number): void
  • Gets or sets the number of samples used by MSAA Note: changing this value in WebGL does not work because depth/stencil textures can't be created with MSAA (see https://github.com/BabylonJS/Babylon.js/issues/12444)

    Returns number

  • Gets or sets the number of samples used by MSAA Note: changing this value in WebGL does not work because depth/stencil textures can't be created with MSAA (see https://github.com/BabylonJS/Babylon.js/issues/12444)

    Parameters

    • samples: number

    Returns void

  • get thicknessMapSize(): Nullable<number>
  • set thicknessMapSize(size: Nullable<number>): void
  • Defines the size of the thickness texture. If null, the texture will have the size of the screen

    Returns Nullable<number>

  • Defines the size of the thickness texture. If null, the texture will have the size of the screen

    Parameters

    Returns void

  • get useFixedThickness(): boolean
  • set useFixedThickness(use: boolean): void
  • Gets or sets a boolean indicating that a fixed thickness should be used instead of generating a thickness texture

    Returns boolean

  • Gets or sets a boolean indicating that a fixed thickness should be used instead of generating a thickness texture

    Parameters

    • use: boolean

    Returns void

  • get useVelocity(): boolean
  • set useVelocity(use: boolean): void
  • Gets or sets a boolean indicating that the velocity should be used when rendering the particles as a fluid. Note: the vertex buffers must contain a "velocity" buffer for this to work!

    Returns boolean

  • Gets or sets a boolean indicating that the velocity should be used when rendering the particles as a fluid. Note: the vertex buffers must contain a "velocity" buffer for this to work!

    Parameters

    • use: boolean

    Returns void

Methods

  • dispose(onlyPostProcesses?: boolean): void
  • Releases all the ressources used by the class

    Parameters

    • Optional onlyPostProcesses: boolean

      If true, releases only the ressources used by the render post processes

    Returns void

Legend

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

Settings

Theme