Class SceneEnvMap
Namespace: ValveResourceFormat.Renderer.SceneEnvironment
Assembly: Renderer.dll
Environment map reflection probe with box or sphere projection.
public class SceneEnvMap : SceneNodeInheritance
object ← SceneNode ← SceneEnvMap
Inherited Members
SceneNode.Tint, SceneNode.Alpha, SceneNode.TintAlpha, SceneNode.Transform, SceneNode.LayerName, SceneNode.LayerEnabled, SceneNode.Visible, SceneNode.BoundingBox, SceneNode.LocalBoundingBox, SceneNode.Name, SceneNode.Id, SceneNode.IsPointMarker, SceneNode.Flags, SceneNode.AdditionalFlags, SceneNode.RenderPasses, SceneNode.UpdateBuffers(Camera), SceneNode.Scene, SceneNode.KeepsMarkerSize, SceneNode.Parent, SceneNode.Children, SceneNode.ParentAttachment, SceneNode.LocalTransform, SceneNode.SetParent(SceneNode?, string?, Matrix4x4?), SceneNode.GetChildFrame(string?), SceneNode.UpdateHierarchy(Scene.UpdateContext), SceneNode.GetRigidTransform(Matrix4x4), SceneNode.ShaderEnvMapVisibility, SceneNode.LightingOrigin, SceneNode.OverlayRenderOrder, SceneNode.CubeMapPrecomputedHandshake, SceneNode.LightProbeVolumePrecomputedHandshake, SceneNode.LightProbeBinding, SceneNode.EnvMapBinding, SceneNode.EntityData, SceneNode.EntityInstance, SceneNode.Update(Scene.UpdateContext), SceneNode.Simulation, SceneNode.Render(Scene.RenderContext), SceneNode.GetSupportedRenderModes(), SceneNode.SetRenderMode(string), SceneNode.Delete(), SceneNode.GetCameraDistance(Camera)
Constructors
SceneEnvMap(Scene, AABB)
Initializes a new instance of the SceneEnvMap class with the given local-space bounds.
public SceneEnvMap(Scene scene, AABB bounds)Parameters
scene Scene
The scene this node belongs to.
bounds AABB
The local-space bounds of the env map volume.
Fields
BoundsExtend
Skin added to the probe's box on every side. The shader tests fragments against the grown box, so anything deciding where the probe reaches must grow it by the same amount.
public const float BoundsExtend = 0.1Field Value
float
NoNormalization
Stands in for a probe whose coefficients could not be read. This evaluates to zero rather than to one: the harmonic holds a radiance, so no value in it means "leave reflections alone", and the shader skips the division when it comes out non positive instead.
public static readonly Vector4 NoNormalizationField Value
Properties
ArrayIndex
Gets or sets the index of the cube in SceneEnvMap.EnvMapTexture when it is an array.
public int ArrayIndex { get; set; }Property Value
int
EdgeFadeDists
Gets the per-axis edge fade distances used for box projection blending.
public Vector3 EdgeFadeDists { get; init; }Property Value
EnvMapTexture
Gets or sets the cubemap or cubemap array texture for this environment map. A cubemap of its own is replaced by the array it is packed into.
public required RenderTexture EnvMapTexture { get; set; }Property Value
HandShake
Gets the handshake value used to match this env map to scene nodes during precomputation.
public int HandShake { get; init; }Property Value
int
IndoorOutdoorLevel
If multiple volumes contain an object, the highest priority volume takes precedence.
public int IndoorOutdoorLevel { get; init; }Property Value
int
InfluenceVolume
Gets the volume of the probe's influence, which orders probes of the same priority, smaller first.
public float InfluenceVolume { get; }Property Value
float
NormalizationSH
Luminance of this probe's own baked radiance, as an L1 spherical harmonic packed for a dot with (normal, 1). It covers the whole probe volume unoccluded, so dividing the per fragment irradiance by it gives specular occlusion.
public Vector4 NormalizationSH { get; init; }Property Value
ProjectionMode
0 = Sphere, 1 = Box
public int ProjectionMode { get; init; }Property Value
int
ShaderIndex
Gets or sets the shader-side index assigned to this env map for UBO packing.
public int ShaderIndex { get; set; }Property Value
int
Methods
CalculateNormalizationSH(float[]?, int)
Reduces one probe's baked radiance to the harmonic SceneEnvMap.NormalizationSH holds. The texture stores L2 in RGB, planar, 27 floats per probe; only the constant and linear bands survive, weighted to luminance and folded together with the basis and cosine lobe constants so the shader can evaluate it as a plain dot with (normal, 1).
public static Vector4 CalculateNormalizationSH(float[]? radianceCoefficients, int arrayIndex)Parameters
radianceCoefficients float[]?
Coefficients for every probe in the array, or null.
arrayIndex int
Index of this probe within the array.
Returns
GetInverseEdgeFade(Vector3)
Reciprocal of an edge fade distance per axis, for the shader to scale distances from the edge by. No fade gives a hard edge rather than a division by zero.
public static Vector3 GetInverseEdgeFade(Vector3 edgeFadeDists)Parameters
edgeFadeDists Vector3
The fade distance on each axis.

