LightCollection
public sealed class LightCollectionThe lights in a scene, in the order they were added.
A list rather than a fixed set of slots, because the number of lights a renderer will draw is a property of the renderer and not of the scene — see LightCollection.Capacity for the number that is true everywhere, and RenderInfo.Features for what the one you got will do.
Properties
| Member | Description |
|---|---|
| Number of lights. |
| The light at |
Fields
| Member | Description |
|---|---|
| A floor, not a limit. The fewest lights any renderer here has ever drawn, and therefore the number to write a scene against if it has to look identical on every device. It is not what the renderer you got will do. Metal, Vulkan and the software renderer draw as many lights as they are given; only OpenGL has a ceiling, because its light loop has to be sized when the shader is compiled, and even there a current context builds for far more than this. The number that is actually true of the running renderer is Nothing about this is a budget: a scene with two lights is not spending two-sixteenths of anything, it is drawing two lights. |
Methods
| Member | Description |
|---|---|
| Adds a light. Past |
| Adds several lights, invalidating the scene once rather than per light. |
| Removes every light. The scene keeps its |
| Whether the scene holds this light. |
| A struct enumerator, so reading the lights allocates nothing. |
| Where |
| Adds a light at Position is not decoration here. The first |
| Removes a light. Returns false when it was not in the scene. |
| Removes the light at |
| Replaces the light at |