Class ReflectiveShadowMap
Constructors
constructor
-
new ReflectiveShadowMap(
scene: Scene,
light: any,
textureDimensions?: { height: number; width: number },
): ReflectiveShadowMapCreates a new RSM for the given light.
Parameters
- scene: Scene
The scene
- light: any
The light to use to generate the RSM textures
- textureDimensions: { height: number; width: number } = ...
The dimensions of the textures to generate. Default: { width: 512, height: 512 }
Returns ReflectiveShadowMap
- scene: Scene
Properties
force Update Light Parameters
Gets or sets a boolean indicating if the light parameters should be recomputed even if the light parameters (position, direction) did not change. You should not set this value to true, except for debugging purpose (if you want to see changes from the inspector, for eg). Instead, you should call updateLightParameters() explicitely at the right time (once the light parameters changed).
Accessors
counters GPU
-
get countersGPU(): { name: string; value: number }[]
Gets the GPU time spent to generate the RSM textures.
Returns { name: string; value: number }[]
enable
-
get enable(): boolean
Enables or disables the RSM generation.
Returns boolean
-
set enable(value: boolean): void
Parameters
- value: boolean
Returns void
flux Texture
-
get fluxTexture(): any
Gets the flux texture generated by the RSM process.
Returns any
light
-
get light(): any
Gets the light used to generate the RSM textures.
Returns any
light Transformation Matrix
-
get lightTransformationMatrix(): Matrix
Gets the light transformation matrix used to generate the RSM textures.
Returns Matrix
normal World Texture
-
get normalWorldTexture(): any
Gets the normal texture generated by the RSM process.
Returns any
position World Texture
-
get positionWorldTexture(): any
Gets the position texture generated by the RSM process.
Returns any
render List
-
get renderList(): any
Gets the render list used to generate the RSM textures.
Returns any
Methods
add Mesh
-
Adds the given mesh to the render list used to generate the RSM textures.
Parameters
Optionalmesh: anyThe mesh to add to the render list used to generate the RSM textures. If not provided, all scene meshes will be added to the render list.
Returns void
dispose
-
Disposes the RSM.
Returns void
set Texture Dimensions
-
Sets the dimensions of the textures to generate.
Parameters
- dimensions: { height: number; width: number }
The dimensions of the textures to generate.
Returns void
- dimensions: { height: number; width: number }
update Light Parameters
-
Recomputes the light transformation matrix. Call this method if you manually changed the light position / direction / etc. and you want to update the RSM textures accordingly. You should also call this method if you add/remove meshes to/from the render list.
Returns void
Class used to generate the RSM (Reflective Shadow Map) textures for a given light. The textures are: position (in world space), normal (in world space) and flux (light intensity)