Game.Rendering.LightType
Assembly:
Assembly-CSharp (Common Unity game assembly; replace with the actual assembly name if different)
Namespace: Game.Rendering
Type:
public enum
Base:
System.Enum (underlying type: System.Int32)
Summary:
LightType is an enumeration used by the rendering system to classify light primitives. It indicates how a light emits illumination and how it should be sampled and shaded by the renderer and shaders. Typical uses include selecting shader paths, determining shadow sampling strategy, and configuring light component behavior in the engine or mods. Be aware that different types have different performance and sampling implications (area lights are generally more expensive than point lights).
Fields
-
Spot = 0
Represents a spot light: a cone-shaped light with a position, direction, range, and cone angle. Good for focused lighting such as street lamps with directional emission. Produces falloff and can cast directional shadows. -
Point = 1
Represents a point (omnidirectional) light that emits equally in all directions from a single point. Useful for small light sources like bulbs. Typically shadowed via cubemap or point-shadow techniques. -
Area = 2
Represents an area light (rectangular or disc-like emitter) that emits across a surface area, producing softer shadows and more realistic lighting at higher cost. Often requires sampling across the area for correct soft-shadow rendering and may be approximated in real-time rendering.
Properties
- None (enum has no custom properties; you receive the value directly)
Constructors
- Implicit default (value 0 = Spot)
Enums have no explicit public constructors; values are created/assigned directly (e.g., LightType.Point).
Methods
- Inherits System.Enum and System.ValueType methods (ToString, HasFlag, CompareTo, etc.)
No custom methods are defined on this enum. Use standard enum operations (switch, comparisons, casting to int) in code and ensure any mapping to engine data or shaders uses the expected integer values.
Usage Example
using Game.Rendering;
public void ConfigureLight(LightComponent light)
{
LightType type = light.Type; // e.g., LightType.Spot
switch (type)
{
case LightType.Spot:
// configure cone angle, direction, shadow settings
break;
case LightType.Point:
// configure range and point-shadow parameters
break;
case LightType.Area:
// configure area size, sampling count, softer shadows
break;
}
}
Additional notes: - When modding, confirm the engine/shader expects the same enum integer values before changing them. - Consider performance: prefer Point or Spot for many lights; use Area only when visual fidelity is required and budget allows.