Class SceneNode
Namespace: ValveResourceFormat.Renderer
Assembly: Renderer.dll
Base class for all objects in the scene graph.
public abstract class SceneNodeInheritance
object ← SceneNode
Derived
CS2BombDamageSceneNode, SceneAggregate.Fragment, HitboxSetSceneNode, MeshCollectionNode, ParticleSceneNode, SceneAggregate, SceneCubemapFog, SceneEnvMap, SceneGradientFog, SceneLight, SceneLightProbe, ScenePostProcessVolume, SceneTonemapController, ShapeSceneNode, SkeletonSceneNode, ToolSceneNode, WireframeSceneNode
Constructors
SceneNode(Scene)
Initializes a new instance of the SceneNode 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
float
BoundingBox
Gets the world-space axis-aligned bounding box. Recomputed from SceneNode.LocalBoundingBox and SceneNode.Transform 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 SceneNode.SetParent(SceneNode?, string?, Matrix4x4?), which follow this one.
public IReadOnlyList<SceneNode> Children { get; }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 SceneNode.EntityData is what the map authored, this is the live entity built from it.
public BaseEntity? EntityInstance { 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
uint
IsPointMarker
Gets whether this node is a fixed-size marker standing in for a point, so its bounds describe the marker rather than anything in the world.
public virtual bool IsPointMarker { get; }Property Value
bool
KeepsMarkerSize
Gets or sets whether this node is a marker drawn at the same size in every scene, rather than magnified with a scene such as a 3D sky. A line joining two markers is not one, since it has to span the distance between them.
public bool KeepsMarkerSize { get; set; }Property Value
bool
KeepsWorldAxes
Gets or sets whether an entity that places this node moves it with its origin only, leaving it aligned to the world axes and unscaled.
public bool KeepsWorldAxes { get; set; }Property Value
bool
LayerEnabled
Gets whether this node's layers are enabled, as kept by the scene. Queues a rebuild on the parent spatial structure when it changes. To hide a single node, use SceneNode.Visible.
public virtual bool LayerEnabled { get; }Property Value
bool
Layers
Gets or sets the visibility layers of the node, set before it is added to the scene. The node is shown only while every one of them is enabled, and one on no layer is never hidden by one.
public ImmutableArray<WorldLayer> Layers { get; set; }Property Value
LightingCache
Gets the environment map and light probe volume this node is lit with, or null for a node without cached lighting.
public SceneNodeLightingCache? LightingCache { get; }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 SceneNode.BoundingBox.
public AABB LocalBoundingBox { get; set; }Property Value
LocalTransform
Gets or sets this node's transform relative to the frame it follows, which SceneNode.Transform is rebuilt from whenever the parent updates. Only meaningful while attached with SceneNode.SetParent(SceneNode?, string?, Matrix4x4?).
public Matrix4x4 LocalTransform { get; set; }Property Value
Name
Gets the name of this node.
public string? Name { get; init; }Property Value
string?
OverlayRenderOrder
Gets or sets the render order for overlay nodes.
public int OverlayRenderOrder { get; set; }Property Value
int
Parent
Gets or sets the node that updates this one, so the scene does not update it on its own. Set by SceneNode.SetParent(SceneNode?, string?, Matrix4x4?), 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 SceneNode.Parent this node follows, or null for the parent itself.
public string? ParentAttachment { get; }Property Value
string?
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
Simulation
Gets or sets which passes after Scene.UpdatePhase.Place this node takes part in. Simulating nodes get Scene.UpdatePhase.Act 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 SceneNode.Tint in XYZ and SceneNode.Alpha in W.
public Vector4 TintAlpha { get; set; }Property Value
Transform
Gets or sets the world transform. Setting this also updates SceneNode.BoundingBox.
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
bool
Methods
AddLayers(ImmutableArray<WorldLayer>)
Puts the node on more layers, besides those it is on already, before it is added to the scene.
public void AddLayers(ImmutableArray<WorldLayer> layers)Parameters
layers ImmutableArray<WorldLayer>
The layers to add.
Delete()
Releases resources held by this node.
public virtual void Delete()GetCameraDistance(Camera)
Gets the distance from the camera to the closest point of this node's bounding box, zero when the camera is inside it.
public virtual float GetCameraDistance(Camera camera)Parameters
camera Camera
The camera to measure distance from.
Returns
float
The 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
IEnumerable<string>
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 SceneNode.LocalTransform 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.

