Class LightingConstants
Namespace: ValveResourceFormat.Renderer.Buffers
Assembly: Renderer.dll
Uniform buffer containing all scene lights and lightmap configuration.
public class LightingConstantsInheritance
object ← LightingConstants
Constructors
LightingConstants()
Initializes a new LightingConstants with all arrays allocated to their maximum sizes.
public LightingConstants()Fields
AmbientDirectionColor
Linear color of the directional ambient lighting multiplied by its intensity, zero when there is none.
public Vector4 AmbientDirectionColorField Value
AmbientDirection_ShadowAmount
Direction the directional ambient lighting is facing (XYZ), and how much the sun shadow darkens it (W).
public Vector4 AmbientDirection_ShadowAmountField Value
AmbientLightingSHB
Blue channel of the ambient lighting.
public Vector4 AmbientLightingSHBField Value
AmbientLightingSHG
Green channel of the ambient lighting.
public Vector4 AmbientLightingSHGField Value
AmbientLightingSHR
Red channel of the ambient lighting: weights against the normal (XYZ) and a constant (W).
public Vector4 AmbientLightingSHRField Value
EnvMapDebugColors
Non-zero to shade reflections with each environment map's debug colour instead of its texture.
public uint EnvMapDebugColorsField Value
uint
EnvMapSizeConstants
Environment map constants: highest mip level (X), number of cubes (Y), RGBM encoding bool (Z).
public Vector4 EnvMapSizeConstantsField Value
LightColor_Brightness
Light color per light. V1: premultiplied linear color (RGB) and render-specular flag (W), like g_vBakedLightColor. V2: linear color (RGB) and brightness (W).
public Vector4[] LightColor_BrightnessField Value
Vector4[]
LightDirection_InvRange
World-space direction (XYZ) and inverse range (W) for each light.
public Vector4[] LightDirection_InvRangeField Value
Vector4[]
LightFallOff
Per-light falloff shaped like g_vSingleLightFalloffParams: linear (X) and quadratic (Y) attenuation, squared range cutoff (Z), zero-at-range bias (W).
public Vector4[] LightFallOffField Value
Vector4[]
LightPosition_Type
World-space position (XYZ) and type (W) for each light.
public Vector4[] LightPosition_TypeField Value
Vector4[]
LightShadowOffsetScale
Shadow atlas offset (XY) and scale (ZW) of each shadowed dynamic light.
public Vector4[] LightShadowOffsetScaleField Value
Vector4[]
LightShadowParams
Per-light shadow and cookie data: the slot in LightingConstants.LightWorldToShadow and LightingConstants.LightShadowOffsetScale (X), -1 for none, the slice of the light cookie volume (Y), -1 for none, and the reciprocal tangent of the outer cone angle (Z).
public Vector4[] LightShadowParamsField Value
Vector4[]
LightSpotInnerOuterCosines
Spot cone cosines or ortho half extents (XY), plus the diffuse and transmissive render gates (ZW), for each light.
public Vector4[] LightSpotInnerOuterCosinesField Value
Vector4[]
LightToWorld
Transform matrix from light space to world space for each light.
public Matrix4x4[] LightToWorldField Value
LightWorldToShadow
Transform from world space to the shadow frustum of each shadowed dynamic light.
public Matrix4x4[] LightWorldToShadowField Value
LightmapUvScale
UV scale applied when sampling the lightmap atlas.
public Vector2 LightmapUvScaleField Value
MAX_LIGHTS
Maximum number of lights (static plus dynamic) supported per scene.
public const int MAX_LIGHTS = 256Field Value
int
MAX_SHADOWED_DYNAMIC_LIGHTS
Maximum number of per-pixel lights with a shadow map, as many as the games light per view.
public const int MAX_SHADOWED_DYNAMIC_LIGHTS = 16Field Value
int
MixedShadowStrength
How strongly the real-time shadow of the one mixed light shows, 0 to 1 as it fades between lights.
public float MixedShadowStrengthField Value
float
NumBarnLights
Number of active barn lights in the scene.
public uint NumBarnLightsField Value
uint
SpecularAlbedoColor
Linear specular color whose highlight is added to the albedo before it is lit, zero when there is none.
public Vector4 SpecularAlbedoColorField Value
SpecularDirection_Power
Direction the specular light travels (XYZ), and the exponent of its highlight (W).
public Vector4 SpecularDirection_PowerField Value
SpecularLitColor
Linear specular color whose highlight is added after lighting where the sun reaches, zero when there is none.
public Vector4 SpecularLitColorField Value
SunColor
Sun color: linear color premultiplied by brightness (RGB), render-specular flag (W).
public Vector4 SunColorField Value
SunDirection
Surface-to-sun direction (XYZ) of the environment light, or zero when the scene has none, and the roughness its specular highlight is no sharper than (W).
public Vector4 SunDirectionField Value
SunLightBakedShadowMask
Sun baked shadow data: V2 stores the one-hot shadow channel mask, V1 stores the sun's baked light index 0-255 in X (-1 for none).
public Vector4 SunLightBakedShadowMaskField Value
Properties
DynamicLightCount
Gets or sets the total light count (static plus dynamic); dynamic lights occupy indices from LightingConstants.StaticLightCount up to this value.
public uint DynamicLightCount { get; set; }Property Value
uint
StaticLightCount
Gets or sets the number of lightmapped lights in the scene.
public uint StaticLightCount { get; set; }Property Value
uint

