Class ReflectionProbe
Constructors
constructor
-
new ReflectionProbe(
name: string,
size: number,
scene: Scene,
generateMipMaps?: boolean,
useFloat?: boolean,
linearSpace?: boolean,
): ReflectionProbeCreates a new reflection probe
Parameters
- name: string
defines the name of the probe
- size: number
defines the texture resolution (for each face)
- scene: Scene
defines the hosting scene
- generateMipMaps: boolean = true
defines if mip maps should be generated automatically (true by default)
- useFloat: boolean = false
defines if HDR data (float data) should be used to store colors (false by default)
- linearSpace: boolean = false
defines if the probe should be generated in linear space or not (false by default)
Returns ReflectionProbe
- name: string
Properties
metadata
Gets or sets an object used to store user defined information for the reflection probe.
name
defines the name of the probe
position
Gets or sets probe position (center of the cube map)
Accessors
cube Texture
-
Gets the internal CubeTexture used to render to
Returns RenderTargetTexture
refresh Rate
-
get refreshRate(): number
Gets or sets the refresh rate to use (on every frame by default)
Returns number
-
set refreshRate(value: number): void
Parameters
- value: number
Returns void
render List
-
Gets or sets the list of meshes to render
Returns Nullable<AbstractMesh[]>
-
Parameters
- value: Nullable<AbstractMesh[]>
Returns void
samples
-
get samples(): number
Gets or sets the number of samples to use for multi-sampling (0 by default). Required WebGL2
Returns number
-
set samples(value: number): void
Parameters
- value: number
Returns void
Methods
attach To Mesh
-
Attach the probe to a specific mesh (Rendering will be done from attached mesh's position)
Parameters
- mesh: Nullable<AbstractMesh>
defines the mesh to attach to
Returns void
- mesh: Nullable<AbstractMesh>
dispose
-
Clean all associated resources
Returns void
get Class Name
-
Get the class name of the refection probe.
Returns string
"ReflectionProbe"
get Scene
serialize
-
Serialize the reflection probe to a JSON representation we can easily use in the respective Parse function.
Returns any
The JSON representation of the texture
set Rendering Auto Clear Depth Stencil
-
Specifies whether or not the stencil and depth buffer are cleared between two rendering groups
Parameters
- renderingGroupId: number
The rendering group id corresponding to its index
- autoClearDepthStencil: boolean
Automatically clears depth and stencil between groups if true.
Returns void
- renderingGroupId: number
to String
-
Converts the reflection probe information to a readable string for debug purpose.
Parameters
OptionalfullDetails: booleanSupports for multiple levels of logging within scene loading
Returns string
the human readable reflection probe info
Class used to generate realtime reflection / refraction cube textures
See
https://doc.babylonjs.com/features/featuresDeepDive/environment/reflectionProbes