Class WorldLightingInfo
Namespace: ValveResourceFormat.Renderer.World
Assembly: Renderer.dll
Scene lighting data including lightmaps, reflection probes, and shadow maps.
public class WorldLightingInfoInheritance
Constructors
WorldLightingInfo(Scene)
Scene lighting data including lightmaps, reflection probes, and shadow maps.
public WorldLightingInfo(Scene scene)Parameters
scene Scene
Properties
BarnLightShadowAtlasSize
Gets or sets the pixel size of the barn light shadow atlas texture.
public int BarnLightShadowAtlasSize { get; set; }Property Value
BarnLights
Gets the list of real-time barn lights.
public List<SceneLight> BarnLights { get; }Property Value
BinnedShadowCasters
Gets the list of shadow casters produced by the most recent call.
public List<BinnedShadowCaster> BinnedShadowCasters { get; }Property Value
CubemapType
Gets or sets the storage format used for environment map cubemaps in this scene.
public CubemapType CubemapType { get; set; }Property Value
EnableDynamicShadows
Gets or sets a value indicating whether dynamic shadow rendering is enabled.
public bool EnableDynamicShadows { get; set; }Property Value
EnvMapHandshakes
Gets the environment map lookup by handshake ID.
public Dictionary<int, SceneEnvMap> EnvMapHandshakes { get; }Property Value
EnvMaps
Gets the list of environment map probes.
public List<SceneEnvMap> EnvMaps { get; }Property Value
HasBakedShadowsFromLightmap
Gets a value indicating whether the lightmap contains baked shadow data.
public bool HasBakedShadowsFromLightmap { get; }Property Value
HasValidLightProbes
Gets or sets a value indicating whether the scene has a complete and usable light probe set.
public bool HasValidLightProbes { get; set; }Property Value
HasValidLightmaps
Gets or sets a value indicating whether the scene has a complete and usable lightmap set.
public bool HasValidLightmaps { get; set; }Property Value
LightProbeType
Gets or sets the storage format used for light probe irradiance data in this scene.
public LightProbeType LightProbeType { get; set; }Property Value
LightProbes
Gets the list of scene light probes.
public List<SceneLightProbe> LightProbes { get; }Property Value
LightingData
Gets or sets the GPU lighting constants buffer for the scene.
public LightingConstants LightingData { get; set; }Property Value
LightmapGameVersionNumber
Gets or sets the game-specific lightmap sub-version number.
public int LightmapGameVersionNumber { get; set; }Property Value
LightmapVersionNumber
Gets or sets the lightmap version number from the world data.
public int LightmapVersionNumber { get; set; }Property Value
Lightmaps
Gets the lightmap textures indexed by uniform name.
public Dictionary<string, RenderTexture> Lightmaps { get; }Property Value
Dictionary<string, RenderTexture>
ProbeHandshakes
Gets the light probe lookup by handshake ID.
public Dictionary<int, SceneLightProbe> ProbeHandshakes { get; }Property Value
Dictionary<int, SceneLightProbe>
SunLightFrustum
Gets the frustum used for sun light shadow culling.
public Frustum SunLightFrustum { get; }Property Value
SunLightShadowBias
Gets or sets the depth bias applied to sun light shadows to reduce self-shadowing artifacts.
public float SunLightShadowBias { get; set; }Property Value
SunLightShadowCoverageScale
Gets or sets a scale factor applied to the sun light shadow coverage area.
public float SunLightShadowCoverageScale { get; set; }Property Value
SunViewProjection
Gets or sets the combined view-projection matrix used for sun shadow rendering.
public Matrix4x4 SunViewProjection { get; }Property Value
UseSceneBoundsForSunLightFrustum
Gets or sets a value indicating whether the sun light frustum is fitted to the scene bounds rather than the camera.
public bool UseSceneBoundsForSunLightFrustum { get; set; }Property Value
Methods
AddEnvironmentMap(SceneEnvMap)
Registers an environment map with the scene, setting the cubemap type on the first entry.
public void AddEnvironmentMap(SceneEnvMap envmap)Parameters
envmap SceneEnvMap
The environment map to add.
AddProbe(SceneLightProbe)
Registers a light probe with the scene, validating its texture set against the lightmap version.
public void AddProbe(SceneLightProbe lightProbe)Parameters
lightProbe SceneLightProbe
The light probe to add.
BinBarnLights(Frustum, Vector3)
Culls and bins visible barn lights for the current frame, packing their shadow faces into the atlas.
public void BinBarnLights(Frustum cameraFrustum, Vector3 cameraPosition)Parameters
cameraFrustum Frustum
The camera frustum used to cull lights not in view.
cameraPosition Vector3
The camera world position used to select shadow map resolution tiers.
BindBarnLightBuffer()
Binds the barn light storage buffer to its reserved shader slot.
public void BindBarnLightBuffer()ClearBarnShadowCache()
Clears cached shadow map data for all registered barn lights.
public void ClearBarnShadowCache()CreateBarnLightBuffer()
Allocates the GPU storage buffer used to pass barn light data to shaders.
public void CreateBarnLightBuffer()DisposeBarnLights()
Releases the barn light GPU buffer, cookie atlas texture, and sampler objects.
public void DisposeBarnLights()SetLightmapTextures(Shader)
Binds lightmap, light probe, and barn light cookie textures to the given shader.
public void SetLightmapTextures(Shader shader)Parameters
shader Shader
The shader to bind lightmap textures to.
StoreLightMappedLights_V1(List<SceneLight>)
Stores stationary and dynamic light data into using the V1 lightmap format.
public void StoreLightMappedLights_V1(List<SceneLight> lights)Parameters
lights List<SceneLight>
The list of scene lights to store.
StoreLightMappedLights_V2(List<SceneLight>)
Stores environment light data and queues real-time barn lights using the V2 lightmap format.
public void StoreLightMappedLights_V2(List<SceneLight> lights)Parameters
lights List<SceneLight>
The list of scene lights to store.
UpdateSunLightFrustum(Camera, float)
Recalculates and to fit the current camera view.
public void UpdateSunLightFrustum(Camera camera, float shadowMapSize = 512)Parameters
camera Camera
The active camera used to position the sun shadow frustum.
shadowMapSize float
The shadow map resolution used to compute coverage and texel snapping.

