Class SceneNode
Namespace: ValveResourceFormat.Renderer
Assembly: Renderer.dll
Base class for all objects in the scene graph.
public abstract class SceneNodeInheritance
Derived
CS2BombDamageSceneNode, SceneAggregate.Fragment, HitboxSetSceneNode, LineSceneNode, MeshCollectionNode, ParticleSceneNode, SceneAggregate, SceneCubemapFog, SceneEnvMap, SceneGradientFog, SceneLight, SceneLightProbe, ScenePostProcessVolume, SceneTonemapController, ShapeSceneNode, SkeletonSceneNode, VisibilitySceneNode
Constructors
SceneNode(Scene)
Initializes a new instance of the class.
protected SceneNode(Scene scene)Parameters
scene Scene
The scene this node belongs to.
Properties
AdditionalFlags
Gets or sets additional non-standard flags.
public SceneNodeFlags AdditionalFlags { get; set; }Property Value
Alpha
Gets or sets the opacity this node draws with.
public float Alpha { get; set; }Property Value
BoundingBox
Gets the world-space axis-aligned bounding box. Recomputed from and
when either is set; nodes whose content lives in world space set it directly.public AABB BoundingBox { get; protected set; }Property Value
Children
Gets the nodes attached with , which follow this one.
public IReadOnlyList<SceneNode> Children { get; }Property Value
CubeMapPrecomputedHandshake
Gets or sets the precomputed handshake value for cubemap assignment.
public int CubeMapPrecomputedHandshake { get; set; }Property Value
EntityData
Gets or sets the associated entity data from the map.
public EntityLump.Entity? EntityData { get; set; }Property Value
EntityInstance
Gets the entity that owns this node and drives its transform, or null when nothing simulates it. Where is what the map authored, this is the live entity built from it.
public BaseEntity? EntityInstance { get; }Property Value
EnvMaps
Gets the environment maps affecting this node.
public List<SceneEnvMap> EnvMaps { get; }Property Value
Flags
Gets or sets the object type flags.
public ObjectTypeFlags Flags { get; set; }Property Value
Id
Gets or sets the unique identifier for this node.
public uint Id { get; set; }Property Value
IsSelected
Gets or sets whether this node is currently selected.
public bool IsSelected { get; set; }Property Value
LayerEnabled
Gets or sets whether this node's layer is enabled. Queues a rebuild on the parent spatial structure.
public virtual bool LayerEnabled { get; set; }Property Value
LayerName
Gets or sets the visibility layer name.
public string? LayerName { get; set; }Property Value
LightProbeBinding
Gets or sets the bound light probe for this node.
public SceneLightProbe? LightProbeBinding { get; set; }Property Value
LightProbeVolumePrecomputedHandshake
Gets or sets the precomputed handshake value for light probe volume assignment.
public int LightProbeVolumePrecomputedHandshake { get; set; }Property Value
LightingOrigin
Gets or sets a custom lighting origin override for environment map and light probe sampling.
public Vector3? LightingOrigin { get; set; }Property Value
LocalBoundingBox
Gets or sets the local-space axis-aligned bounding box. Setting this also updates .
public AABB LocalBoundingBox { get; set; }Property Value
LocalTransform
Gets or sets this node's transform relative to the frame it follows, which is rebuilt from whenever the parent updates. Only meaningful while attached with .
public Matrix4x4 LocalTransform { get; set; }Property Value
Name
Gets the name of this node.
public string? Name { get; init; }Property Value
OverlayRenderOrder
Gets or sets the render order for overlay nodes.
public int OverlayRenderOrder { get; set; }Property Value
Parent
Gets or sets the node that updates this one, so the scene does not update it on its own. Set by
, or directly by a node that places and updates its parts itself.public SceneNode? Parent { get; set; }Property Value
ParentAttachment
Gets the attachment point or bone of this node follows, or null for the parent itself.
public string? ParentAttachment { get; }Property Value
RenderPasses
Flags for when should this node be drawn and where.
public CustomRenderPasses RenderPasses { get; set; }Property Value
Scene
Gets the scene this node belongs to.
public Scene Scene { get; }Property Value
ShaderEnvMapVisibility
Gets or sets the precomputed environment map visibility bitfield for shaders.
public SceneEnvMap.EnvMapVisibility128 ShaderEnvMapVisibility { get; set; }Property Value
SceneEnvMap.EnvMapVisibility128
Simulation
Gets or sets which passes after this node takes part in. Simulating nodes get too, and belong in the dynamic partition even if they never move.
public NodeSimulation Simulation { get; protected set; }Property Value
Tint
Gets or sets the color multiplier this node draws with, in gamma space.
public Vector3 Tint { get; set; }Property Value
TintAlpha
Gets or sets in XYZ and in W.
public Vector4 TintAlpha { get; set; }Property Value
Transform
Gets or sets the world transform. Setting this also updates .
public Matrix4x4 Transform { get; set; }Property Value
Visible
Gets or sets whether the node itself wants to be drawn, independently of its layer. The node remains in the scene graph and is checked each frame.
public bool Visible { get; set; }Property Value
Methods
Delete()
Releases resources held by this node.
public virtual void Delete()GetCameraDistance(Camera)
Gets the squared distance from this node's bounding box center to the camera.
public float GetCameraDistance(Camera camera)Parameters
camera Camera
The camera to measure distance from.
Returns
The squared distance to the camera.
GetChildFrame(string?)
Gets the world frame a child attached at attachmentName follows: this node's transform without its scale. A model resolves attachment points and bones.
public virtual Matrix4x4 GetChildFrame(string? attachmentName)Parameters
attachmentName string?
The attachment point or bone, or null for the node itself.
Returns
GetRigidTransform(Matrix4x4)
Removes the scale from a transform, keeping its rotation and translation.
protected static Matrix4x4 GetRigidTransform(Matrix4x4 transform)Parameters
transform Matrix4x4
Returns
GetSupportedRenderModes()
Returns the render modes supported by this node.
public virtual IEnumerable<string> GetSupportedRenderModes()Returns
Render(RenderContext)
Called each frame to render this node.
public virtual void Render(Scene.RenderContext context)Parameters
context Scene.RenderContext
The current render context.
SetParent(SceneNode?, string?, Matrix4x4?)
Attaches this node to parent, or detaches it when null. From then on the parent places it after every update, at in the frame of attachmentName, and updates it.
public void SetParent(SceneNode? parent, string? attachmentName = null, Matrix4x4? localTransform = null)Parameters
parent SceneNode?
The node to follow, or null to stand alone again.
attachmentName string?
An attachment point or bone of a model parent, or null for the parent itself.
localTransform Matrix4x4?
The transform in that frame, or null to keep the current world transform.
SetRenderMode(string)
Sets the active render mode for this node.
public virtual void SetRenderMode(string mode)Parameters
mode string
The render mode name to activate.
Update(UpdateContext)
Called each frame to update this node's state.
public virtual void Update(Scene.UpdateContext context)Parameters
context Scene.UpdateContext
The current update context.
UpdateBuffers(Camera)
Uploads this node's buffers. Called on visible nodes only, before any pass draws.
public virtual void UpdateBuffers(Camera camera)Parameters
camera Camera
The camera the frame is drawn with.
UpdateHierarchy(UpdateContext)
Updates this node, then places and updates everything attached to it, depth first.
public void UpdateHierarchy(Scene.UpdateContext context)Parameters
context Scene.UpdateContext
The current update context.

