A light probe that applies environment IBL to objects located inside its volume of influence. Used for adding local IBL to a scene.
const probe = new v3d.CubeReflectionProbe();
probe.update(scene, renderer);
app.scene.add(probe);
size — (optional) texture size. Default is 256
.
Creates a new CubeReflectionProbe.
See the base Object3D class for common properties.
Controls how big the sphere/box of influence is. This parameter defines a
sphere radius if influenceType equals
v3d.ReflectionProbeTypeSphere and half the cube edge size
if influenceType equals v3d.ReflectionProbeTypeBox.
The influence volume is used for testing which objects are affected by the
probe (simply those contained inside the volume). Default is 1
.
It's recommended to keep this value and .parallaxDistance the same for more consistent results.
Limits scene objects affected by the probe to this group. If not null
it
is used instead of .influenceType and .influenceDistance to
determine which objects should be affected. Default is null
, which means
that the .influenceType and .influenceDistance settings are
used as usual.
If .influenceGroup is not null
this option (if true) makes it so
only objects that don't belong to .influenceGroup are affected by
the probe. Default is false.
Defines the type of the influence volume. Can be v3d.ReflectionProbeTypeInfinite (used for the Scene.worldEnvMapProbe probe object), v3d.ReflectionProbeTypeSphere or v3d.ReflectionProbeTypeBox. The influence volume is used for testing which objects are affected by the probe (simply those contained inside the volume). Default is v3d.ReflectionProbeTypeSphere.
It's recommended to keep this value and .parallaxType the same for more consistent results.
The inverse of matrixWorld.
Controls how big the sphere/box for the parallax effect is. This parameter
defines a sphere radius if parallaxType equals
v3d.ReflectionProbeTypeSphere and half the cube edge size if
parallaxType equals v3d.ReflectionProbeTypeBox.
The parallax volume is used for calculating the parallax effect. Default is 1
.
It's recommended to keep this value and .influenceDistance the same for more consistent results.
Defines the type of the parallax volume. Can be v3d.ReflectionProbeTypeInfinite (used for the Scene.worldEnvMapProbe probe object), v3d.ReflectionProbeTypeSphere or v3d.ReflectionProbeTypeBox. The parallax volume is used for calculating the parallax effect. Default is v3d.ReflectionProbeTypeSphere.
It's recommended to keep this value and .influenceType the same for more consistent results.
Objects located further than this value won't appear on the probe's environment map. Default is 100.
Objects located closer than this value won't appear on the probe's
environment map. Default is 0.1
.
Controls the intensity (exposure) of the probe's environment map. Default
is 1
.
A WebGLRenderTarget instance containing the rendered environment map. Default is null. Updated automatically after calling the .update method.
A string 'CubeReflectionProbe'. This can be used to find all CubeReflectionProbe objects. Shouldn't be changed.
If not null, only objects from this group are rendered into the environment map (see also Object3D.groupNames). Default is null, which means no visibility group is used and the probe renders all scene objects.
If .visibilityGroup is not null this option (if true) makes it so only objects that don't belong to the specified .visibilityGroup are rendered into the environment map. Default is false.
See the base Object3D class for common methods.
Remove resources related to the render targets used by this object from memory.
mesh — a Mesh object to test intersections with.
Check if there's any intersection between the probe's influence volume
(see .influenceDistance and .influenceType) and the given
mesh object. Returns the checking result. Exact calculations depend on
.influenceType, for example for v3d.ReflectionProbeTypeInfinite
the method always returns true
.
cubeRT — a cube render target containing the environment map.
A callback executed after the environment map is rendered in the .update method. Receives a WebGLCubeRenderTarget instance in the cubeRT parameter which contains the rendering results. The value returned from this function must be an instance of WebGLRenderTarget and will be used as a final .renderTarget. Returns the same cubeRT render target by default.
This callback can be overridden to apply custom changes to the environment map each time .update is called. It is already used for all cube reflection probes in the scene if it has its IBL environment mode set to PMREM.
size — new environment map size.
Set the environment map size.
scene — a scene to render.
renderer — a WebGLRenderer instance.
Render the given scene into the probe's environment map. The rendering result will be in the .renderTarget property.
For more info on how to obtain the source code of this module see this page.