Class SceneLight
Namespace: ValveResourceFormat.Renderer.SceneEnvironment
Assembly: Renderer.dll
Scene node representing a light source with type, color, and attenuation.
public class SceneLight : SceneNodeInheritance
object ← SceneNode ← SceneLight
Inherited Members
SceneNode.Transform, SceneNode.LayerName, SceneNode.LayerEnabled, SceneNode.BoundingBox, SceneNode.LocalBoundingBox, SceneNode.Name, SceneNode.Id, SceneNode.IsSelected, SceneNode.Flags, SceneNode.Scene, SceneNode.EnvMaps, SceneNode.ShaderEnvMapVisibility, SceneNode.LightingOrigin, SceneNode.OverlayRenderOrder, SceneNode.CubeMapPrecomputedHandshake, SceneNode.LightProbeVolumePrecomputedHandshake, SceneNode.LightProbeBinding, SceneNode.EntityData, SceneNode.Update(Scene.UpdateContext), SceneNode.Render(Scene.RenderContext), SceneNode.GetSupportedRenderModes(), SceneNode.SetRenderMode(string), SceneNode.Delete(), SceneNode.GetCameraDistance(Camera)
Constructors
SceneLight(Scene)
Scene node representing a light source with type, color, and attenuation.
public SceneLight(Scene scene)Parameters
scene Scene
Properties
AttenuationLinear
Gets or sets the linear attenuation coefficient.
public float AttenuationLinear { get; set; }Property Value
AttenuationQuadratic
Gets or sets the quadratic attenuation coefficient.
public float AttenuationQuadratic { get; set; }Property Value
BarnFaces
Gets the precomputed face data array (1 face for barn lights, 1–6 for omni lights).
public SceneLight.BarnFaceData[] BarnFaces { get; }Property Value
Brightness
Gets or sets the brightness (intensity) of the light.
public float Brightness { get; set; }Property Value
BrightnessScale
Gets or sets the additional brightness scale multiplier.
public float BrightnessScale { get; set; }Property Value
CastShadows
Gets or sets whether this light casts shadows.
public int CastShadows { get; set; }Property Value
Color
Gets or sets the sRGB color of the light.
public Vector3 Color { get; set; }Property Value
CookieTexturePath
Gets or sets the material path of the cookie texture, or null if none.
public string? CookieTexturePath { get; set; }Property Value
DirectLight
Gets or sets the direct light contribution mode (0 = off, 1 = stationary, 2 = dynamic).
public int DirectLight { get; set; }Property Value
Direction
Gets or sets the normalized direction the light faces.
public Vector3 Direction { get; set; }Property Value
Entity
Gets or sets the entity class that created this light.
public SceneLight.EntityType Entity { get; set; }Property Value
FallOff
Gets or sets the distance falloff skirt fraction.
public float FallOff { get; set; }Property Value
IsDirty
Gets or sets whether this light's face data needs to be recomputed.
public bool IsDirty { get; set; }Property Value
LuminaireAnisotropy
Gets or sets the luminaire anisotropy for capsule-shaped area lights.
public float LuminaireAnisotropy { get; set; }Property Value
LuminaireShape
Gets or sets the luminaire shape index (0 = sphere, 1 = capsule, 2 = rect).
public int LuminaireShape { get; set; }Property Value
LuminaireSize
Gets or sets the luminaire (source) size used for area light calculations.
public float LuminaireSize { get; set; }Property Value
MinRoughness
Gets or sets the minimum roughness clamped for specular highlight calculations.
public float MinRoughness { get; set; }Property Value
Position
Gets or sets the world-space position of the light.
public Vector3 Position { get; set; }Property Value
PrecomputedBounds
Gets or sets the axis-aligned precomputed world bounds.
public AABB PrecomputedBounds { get; set; }Property Value
PrecomputedFieldsValid
Gets or sets whether the precomputed OBB fields below are valid.
public bool PrecomputedFieldsValid { get; set; }Property Value
PrecomputedObbAngles
Gets or sets the Euler angles of the precomputed oriented bounding box.
public Vector3 PrecomputedObbAngles { get; set; }Property Value
PrecomputedObbExtent
Gets or sets the half-extents of the precomputed oriented bounding box.
public Vector3 PrecomputedObbExtent { get; set; }Property Value
PrecomputedObbOrigin
Gets or sets the center of the precomputed oriented bounding box.
public Vector3 PrecomputedObbOrigin { get; set; }Property Value
PrecomputedSubObbAngles
Gets or sets the Euler angles of the precomputed sub-OBBs, one per frustum.
public Vector3[]? PrecomputedSubObbAngles { get; set; }Property Value
Vector3[]?
PrecomputedSubObbExtents
Gets or sets the half-extents of the precomputed sub-OBBs, one per frustum.
public Vector3[]? PrecomputedSubObbExtents { get; set; }Property Value
Vector3[]?
PrecomputedSubObbOrigins
Gets or sets the centers of the precomputed sub-OBBs, one per frustum.
public Vector3[]? PrecomputedSubObbOrigins { get; set; }Property Value
Vector3[]?
PrecomputedSubfrusta
Gets or sets the number of precomputed sub-frusta for omni lights.
public int PrecomputedSubfrusta { get; set; }Property Value
Range
Gets or sets the maximum range of the light in world units.
public float Range { get; set; }Property Value
ShadowMapSize
Gets or sets the shadow map resolution in texels.
public int ShadowMapSize { get; set; }Property Value
Shape
Gets or sets the shape blend factor for barn lights.
public float Shape { get; set; }Property Value
Shear
Gets or sets the 2D shear offset for barn lights.
public Vector2 Shear { get; set; }Property Value
SizeParams
Gets or sets the half-width, half-height, and near-plane reciprocal for barn lights.
public Vector3 SizeParams { get; set; }Property Value
SkirtNear
Gets or sets the near skirt distance for perspective barn lights.
public float SkirtNear { get; set; }Property Value
SoftX
Gets or sets the horizontal soft edge width for barn lights.
public float SoftX { get; set; }Property Value
SoftY
Gets or sets the vertical soft edge width for barn lights.
public float SoftY { get; set; }Property Value
SpotInnerAngle
Gets or sets the inner cone half-angle for spot lights in degrees.
public float SpotInnerAngle { get; set; }Property Value
SpotOuterAngle
Gets or sets the outer cone half-angle for spot lights in degrees.
public float SpotOuterAngle { get; set; }Property Value
StationaryLightIndex
Light index to a baked lightmap. Range: 0..255 for GameLightmapVersion 1 and 0..3 for GameLightmapVersion 2.
public int StationaryLightIndex { get; set; }Property Value
Type
Gets or sets the shader light type used during rendering.
public SceneLight.LightType Type { get; set; }Property Value
Methods
AnglesToDirection(Vector3)
Converts Euler pitch/yaw angles to a normalized forward direction vector.
public static Vector3 AnglesToDirection(Vector3 angles)Parameters
angles Vector3
Returns
ComputeBarnFaces(Dictionary<string, int>)
Recomputes the array from the current light properties.
public void ComputeBarnFaces(Dictionary<string, int> cookiePaths)Parameters
cookiePaths Dictionary<string, int>
Map from cookie material path to cookie atlas index.
FromEntityProperties(Scene, EntityType, Entity)
Creates a populated from entity key-value properties.
public static SceneLight FromEntityProperties(Scene scene, SceneLight.EntityType type, EntityLump.Entity entity)Parameters
scene Scene
type SceneLight.EntityType
entity EntityLump.Entity
Returns
GetShadowFaceDimensions()
Returns the shadow map pixel dimensions for this light, accounting for aspect ratio.
public (int W, int H) GetShadowFaceDimensions()Returns
IsAccepted(string)
Returns whether the given entity classname is a recognized light type, and which it maps to.
public static (bool Accepted, SceneLight.EntityType Type) IsAccepted(string classname)Parameters
classname string

