Interface ILightManager
Interface for managing lights in a scene.
public interface ILightManager : ISerialization, IGraphicsResource
- Inherited Members
Methods
BindLights(Viewport, IRenderDevice, Camera)
Binds the lights to the shader program for rendering.
void BindLights(Viewport viewport, IRenderDevice renderer, Camera camera)
Parameters
viewportViewportrendererIRenderDevicecameraCamera
ClearLights()
Removes all lights from the collection.
void ClearLights()
Remarks
Call this method to reset the collection to an empty state. After calling this method, no lights will remain until new ones are added.
ContainsLight(Light)
Determines whether the specified light is contained within the collection.
bool ContainsLight(Light light)
Parameters
lightLightThe light to locate in the collection. Cannot be null.
Returns
- bool
true if the specified light is found in the collection; otherwise, false.
CullLights(Viewport, IRenderDevice, Camera)
Culls the lights based on the camera's view and the viewport.
void CullLights(Viewport viewport, IRenderDevice renderer, Camera camera)
Parameters
viewportViewportrendererIRenderDevicecameraCamera
Dispose(IRenderDevice)
Disposes of the light manager and releases any resources.
void Dispose(IRenderDevice renderDevice)
Parameters
renderDeviceIRenderDevice
DisposeLights(IRenderDevice)
Releases all light resources associated with the specified render device.
void DisposeLights(IRenderDevice renderDevice)
Parameters
renderDeviceIRenderDeviceThe render device whose light resources will be disposed. Cannot be null.
ForEachLight(Action<Light>)
Performs an action on each light in the scene, regardless of type.
void ForEachLight(Action<Light> action)
Parameters
ForEachLight<T>(Action<T>)
Performs an action on each light of the specified type in the scene.
void ForEachLight<T>(Action<T> action) where T : Light
Parameters
actionAction<T>
Type Parameters
T
GetLightCount<T>()
Gets the ligt count of the specified type.
int GetLightCount<T>() where T : Light
Returns
Type Parameters
T
GetLight<T>()
Gets the total light count across all types.
T GetLight<T>() where T : Light
Returns
- T
Type Parameters
T
Init(IRenderDevice)
Initializes the light manager with the given render device.
void Init(IRenderDevice renderDevice)
Parameters
renderDeviceIRenderDevice
SetLightSpaceMatrix(Matrix4)
Sets the light view matrix for the light manager, which is used to transform the light's perspective in the scene.
void SetLightSpaceMatrix(Matrix4 lightViewMatrix)
Parameters
lightViewMatrixMatrix4