@babylonjs/core
Version:
Getting started? Play directly with the Babylon.js API using our [playground](https://playground.babylonjs.com/). It also contains a lot of samples to learn how to use it.
96 lines (95 loc) • 4.14 kB
TypeScript
import type { Scene } from "../../scene.js";
import { RenderTargetTexture } from "../../Materials/Textures/renderTargetTexture.js";
import { Plane } from "../../Maths/math.plane.js";
/**
* Mirror texture can be used to simulate the view from a mirror in a scene.
* It will dynamically be rendered every frame to adapt to the camera point of view.
* You can then easily use it as a reflectionTexture on a flat surface.
* In case the surface is not a plane, please consider relying on reflection probes.
* @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/reflectionTexture#mirrortexture
*/
export declare class MirrorTexture extends RenderTargetTexture {
/**
* Define the reflection plane we want to use. The mirrorPlane is usually set to the constructed reflector.
* It is possible to directly set the mirrorPlane by directly using a Plane(a, b, c, d) where a, b and c give the plane normal vector (a, b, c) and d is a scalar displacement from the mirrorPlane to the origin. However in all but the very simplest of situations it is more straight forward to set it to the reflector as stated in the doc.
* @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/reflectionTexture#mirrors
*/
mirrorPlane: Plane;
/**
* Define the blur ratio used to blur the reflection if needed.
*/
set blurRatio(value: number);
get blurRatio(): number;
/**
* Define the adaptive blur kernel used to blur the reflection if needed.
* This will autocompute the closest best match for the `blurKernel`
*/
set adaptiveBlurKernel(value: number);
/**
* Define the blur kernel used to blur the reflection if needed.
* Please consider using `adaptiveBlurKernel` as it could find the closest best value for you.
*/
set blurKernel(value: number);
/**
* Define the blur kernel on the X Axis used to blur the reflection if needed.
* Please consider using `adaptiveBlurKernel` as it could find the closest best value for you.
*/
set blurKernelX(value: number);
get blurKernelX(): number;
/**
* Define the blur kernel on the Y Axis used to blur the reflection if needed.
* Please consider using `adaptiveBlurKernel` as it could find the closest best value for you.
*/
set blurKernelY(value: number);
get blurKernelY(): number;
private _autoComputeBlurKernel;
protected _onRatioRescale(): void;
private _updateGammaSpace;
private _imageProcessingConfigChangeObserver;
private _transformMatrix;
private _mirrorMatrix;
private _blurX;
private _blurY;
private _adaptiveBlurKernel;
private _blurKernelX;
private _blurKernelY;
private _blurRatio;
private _sceneUBO;
private _currentSceneUBO;
/**
* Instantiates a Mirror Texture.
* Mirror texture can be used to simulate the view from a mirror in a scene.
* It will dynamically be rendered every frame to adapt to the camera point of view.
* You can then easily use it as a reflectionTexture on a flat surface.
* In case the surface is not a plane, please consider relying on reflection probes.
* @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/reflectionTexture#mirrors
* @param name
* @param size
* @param scene
* @param generateMipMaps
* @param type
* @param samplingMode
* @param generateDepthBuffer
*/
constructor(name: string, size: number | {
width: number;
height: number;
} | {
ratio: number;
}, scene?: Scene, generateMipMaps?: boolean, type?: number, samplingMode?: number, generateDepthBuffer?: boolean);
private _preparePostProcesses;
/**
* Clone the mirror texture.
* @returns the cloned texture
*/
clone(): MirrorTexture;
/**
* Serialize the texture to a JSON representation you could use in Parse later on
* @returns the serialized JSON representation
*/
serialize(): any;
/**
* Dispose the texture and release its associated resources.
*/
dispose(): void;
}