Class ParticleSceneNode
Namespace: ValveResourceFormat.Renderer.SceneNodes
Assembly: Renderer.dll
Scene node that renders particle system effects.
public class ParticleSceneNode : SceneNodeInheritance
object ← SceneNode ← ParticleSceneNode
Inherited Members
SceneNode.Transform, SceneNode.LayerName, SceneNode.LayerEnabled, SceneNode.Visible, SceneNode.BoundingBox, SceneNode.LocalBoundingBox, SceneNode.Name, SceneNode.Id, SceneNode.IsSelected, SceneNode.Flags, SceneNode.RenderPasses, SceneNode.UpdateBuffers(Camera), SceneNode.Scene, SceneNode.Parent, SceneNode.EnvMaps, SceneNode.ShaderEnvMapVisibility, SceneNode.LightingOrigin, SceneNode.OverlayRenderOrder, SceneNode.CubeMapPrecomputedHandshake, SceneNode.LightProbeVolumePrecomputedHandshake, SceneNode.LightProbeBinding, 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
ParticleSceneNode(Scene, ParticleSystem, ParticleSnapshot?, bool, bool)
Initializes a new instance of the class.
public ParticleSceneNode(Scene scene, ParticleSystem particleSystem, ParticleSnapshot? particleSnapshot = null, bool preview = false, bool playedByEntity = false)Parameters
scene Scene
The scene this node belongs to.
particleSystem ParticleSystem
The particle system resource to simulate and render.
particleSnapshot ParticleSnapshot?
Optional snapshot to provide initial particle data (e.g. from a map entity).
preview bool
Whether to load preview control point state, and loop playback when finished.
playedByEntity bool
Whether a map entity plays this effect, in which case its control points come from that entity rather than from a control point configuration.
Properties
FrametimeMultiplier
Gets or sets a time-scale multiplier applied to the particle simulation each frame.
public float FrametimeMultiplier { get; set; }Property Value
IsPlaying
Whether the system is switched on. A stopped system neither simulates nor draws.
public bool IsPlaying { get; }Property Value
Loop
Whether the system starts over once it has finished. Set for preview playback; off in a scene, where an effect that has run out stays gone. Changing it takes effect at the next
.public bool Loop { get; set; }Property Value
PlaybackMode
Which parts of the effect a playback cycle covers. Changing it takes effect at the next
.public ParticlePlaybackMode PlaybackMode { get; set; }Property Value
Preview
Whether to load preview control point state, and loop playback when finished.
public bool Preview { get; set; }Property Value
PreviewModel
Gets the preview model scene node loaded from particle preview state, if any.
public ModelSceneNode? PreviewModel { get; }Property Value
WantsSceneDepth
Gets whether this system samples the resolved opaque depth.
public bool WantsSceneDepth { get; }Property Value
Methods
BindControlPoint(int, SceneNode, Matrix4x4)
Places a control point at a transform and keeps it there relative to a scene node, so a control point bound to an entity follows that entity when something moves it.
public void BindControlPoint(int index, SceneNode target, Matrix4x4 transform)Parameters
index int
The index of the control point to place.
target SceneNode
The node the control point follows.
transform Matrix4x4
The world transform the control point takes while the node is still.
CreateModelParticles(Scene, Model, ModelSceneNode)
Creates particle nodes for the particle systems referenced by a model's keyvalues (particles_list) and wires each one to the given model node according to the entry's attachment_type. Follow types track the model or attachment point while it animates; the other types are placed once at spawn. Entries with an unknown type are skipped.
public static List<ParticleSceneNode> CreateModelParticles(Scene scene, Model model, ModelSceneNode modelNode)Parameters
scene Scene
The scene the nodes belong to.
model Model
The model referencing the particle systems.
modelNode ModelSceneNode
The model node providing the attachment points.
Returns
The created particle nodes. The caller adds them to the scene.
Delete()
Releases resources held by this node.
public override void Delete()GetControlPoint(int)
Gets the control point at the given index from the particle renderer.
public ControlPoint GetControlPoint(int index)Parameters
index int
The index of the control point to retrieve.
Returns
The control point at the specified index.
GetSupportedRenderModes()
Returns the render modes supported by this node.
public override IEnumerable<string> GetSupportedRenderModes()Returns
Play()
Switches the system on and replays it from its current transform.
public void Play()PlayEndCap()
Stops emission and plays the system's endcap, which is what the engine does when something tells a running effect to end.
public void PlayEndCap()Prewarm(Camera)
Forces this system's renderers to draw once with temporary particles.
public void Prewarm(Camera camera)Parameters
camera Camera
Render(RenderContext)
Called each frame to render this node.
public override void Render(Scene.RenderContext context)Parameters
context Scene.RenderContext
The current render context.
Restart()
Restarts the particle system at the start of its next update.
public void Restart()SetControlPoint(int, Matrix4x4)
Places a control point at a transform, taking its position and full orientation frame the same way control point 0 is seeded from this node's transform.
public void SetControlPoint(int index, Matrix4x4 transform)Parameters
index int
The index of the control point to place.
transform Matrix4x4
The world transform the control point takes.
SetDetailLevel(ParticleDetailLevel)
Sets the particle detail tier used by detail-tiered inputs and by child systems.
public void SetDetailLevel(ParticleDetailLevel level)Parameters
level ParticleDetailLevel
SetRenderMode(string)
Sets the active render mode for this node.
public override void SetRenderMode(string mode)Parameters
mode string
The render mode name to activate.
SetTextureOverride(string)
Replaces the texture drawn by every renderer in this system and its children.
public void SetTextureOverride(string textureName)Parameters
textureName string
SetTextureOverride(RenderTexture)
Replaces the texture drawn by every renderer in this system and its children.
public void SetTextureOverride(RenderTexture texture)Parameters
texture RenderTexture
Stop()
Switches the system off, dropping whatever it had alive.
public void Stop()Update(UpdateContext)
Called each frame to update this node's state.
public override 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 override void UpdateBuffers(Camera camera)Parameters
camera Camera
The camera the frame is drawn with.

