Class FluidRenderingTargetRenderer
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
-
new FluidRenderingTargetRenderer(
scene: Scene,
camera?: any,
shaderLanguage?: any,
): FluidRenderingTargetRendererCreates an instance of the class
Parameters
- scene: Scene
Scene used to render the fluid object into
Optionalcamera: anyCamera used to render the fluid object. If not provided, use the active camera of the scene instead
OptionalshaderLanguage: anyThe shader language to use
Returns FluidRenderingTargetRenderer
- scene: Scene
Properties
density
Density of the fluid (positive number). The higher the value, the more opaque the fluid.
dir Light
Direction of the light. The fluid is assumed to be lit by a directional light
fluid Color
Fluid color. Not used if generateDiffuseTexture is true
fresnel Clamp
Strength of the fresnel effect (value between 0 and 1). Lower the value if you want to soften the specular effect
minimum Thickness
Minimum thickness of the particles (positive number). If useFixedThickness is true, minimumThickness is the thickness used
refraction Strength
Strength of the refraction (positive number, but generally between 0 and 0.3).
specular Power
Strength of the specular power (positive number). Increase the value to make the specular effect more concentrated
Accessors
blur Depth Depth Scale
-
get blurDepthDepthScale(): number
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
-
set blurDepthDepthScale(scale: number): void
Parameters
- scale: number
Returns void
blur Depth Filter Size
-
get blurDepthFilterSize(): 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)
Returns number
-
set blurDepthFilterSize(filterSize: number): void
Parameters
- filterSize: number
Returns void
blur Depth Max Filter Size
-
get blurDepthMaxFilterSize(): 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)
Returns number
-
set blurDepthMaxFilterSize(maxFilterSize: number): void
Parameters
- maxFilterSize: number
Returns void
blur Depth Num Iterations
-
get blurDepthNumIterations(): 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)
Returns number
-
set blurDepthNumIterations(numIterations: number): void
Parameters
- numIterations: number
Returns void
blur Depth Size Divisor
-
get blurDepthSizeDivisor(): 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
Returns number
-
set blurDepthSizeDivisor(scale: number): void
Parameters
- scale: number
Returns void
blur Thickness Filter Size
-
get blurThicknessFilterSize(): 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)
Returns number
-
set blurThicknessFilterSize(filterSize: number): void
Parameters
- filterSize: number
Returns void
blur Thickness Num Iterations
-
get blurThicknessNumIterations(): 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)
Returns number
-
set blurThicknessNumIterations(numIterations: number): void
Parameters
- numIterations: number
Returns void
blur Thickness Size Divisor
-
get blurThicknessSizeDivisor(): 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
Returns number
-
set blurThicknessSizeDivisor(scale: number): void
Parameters
- scale: number
Returns void
camera
-
get camera(): Nullable<Camera>
Gets the camera used for the rendering
Returns Nullable<Camera>
composite Mode
-
get compositeMode(): boolean
If compositeMode is true (default: false), when the alpha value of the background (the scene rendered without the fluid objects) is 0, the final alpha value of the pixel will be set to the thickness value. This way, it is possible to composite the fluid rendering on top of the HTML background.
Returns boolean
-
set compositeMode(value: boolean): void
Parameters
- value: boolean
Returns void
debug
-
get debug(): boolean
Gets or sets a boolean indicating if we should display a specific texture (given by debugFeature) for debugging purpose
Returns boolean
-
set debug(debug: boolean): void
Parameters
- debug: boolean
Returns void
debug Feature
-
Gets or sets the feature (texture) to be debugged. Not used if debug is false
Returns FluidRenderingDebug
-
Parameters
- feature: FluidRenderingDebug
Returns void
depth Map Size
-
get depthMapSize(): Nullable<number>
Defines the size of the depth texture. If null, the texture will have the size of the screen
Returns Nullable<number>
-
set depthMapSize(size: Nullable<number>): void
Parameters
- size: Nullable<number>
Returns void
diffuse Map Size
-
get diffuseMapSize(): Nullable<number>
Defines the size of the diffuse texture. If null, the texture will have the size of the screen
Returns Nullable<number>
-
set diffuseMapSize(size: Nullable<number>): void
Parameters
- size: Nullable<number>
Returns void
enable Blur Depth
-
get enableBlurDepth(): boolean
Gets or sets a boolean indicating that the depth texture should be blurred
Returns boolean
-
set enableBlurDepth(enable: boolean): void
Parameters
- enable: boolean
Returns void
enable Blur Thickness
-
get enableBlurThickness(): boolean
Gets or sets a boolean indicating that the thickness texture should be blurred
Returns boolean
-
set enableBlurThickness(enable: boolean): void
Parameters
- enable: boolean
Returns void
environment Map
-
get environmentMap(): any
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 any
-
set environmentMap(map: any): void
Parameters
- map: any
Returns void
generate Diffuse Texture
-
get generateDiffuseTexture(): boolean
Gets or sets a boolean indicating that the diffuse texture should be generated and used for the rendering
Returns boolean
-
set generateDiffuseTexture(generate: boolean): void
Parameters
- generate: boolean
Returns void
need Initialization
-
get needInitialization(): boolean
Returns true if the class needs to be reinitialized (because of changes in parameterization)
Returns boolean
samples
-
get samples(): 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)
Returns number
-
set samples(samples: number): void
Parameters
- samples: number
Returns void
shader Language
-
get shaderLanguage(): ShaderLanguage
Gets the shader language used in this renderer
Returns ShaderLanguage
thickness Map Size
-
get thicknessMapSize(): Nullable<number>
Defines the size of the thickness texture. If null, the texture will have the size of the screen
Returns Nullable<number>
-
set thicknessMapSize(size: Nullable<number>): void
Parameters
- size: Nullable<number>
Returns void
use Fixed Thickness
-
get useFixedThickness(): boolean
Gets or sets a boolean indicating that a fixed thickness should be used instead of generating a thickness texture
Returns boolean
-
set useFixedThickness(use: boolean): void
Parameters
- use: boolean
Returns void
use Velocity
-
get useVelocity(): 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!
Returns boolean
-
set useVelocity(use: boolean): void
Parameters
- use: boolean
Returns void
Class used to render an object as a fluid thanks to different render target textures (depth, thickness, diffuse)