public sealed class Sandbox.Rendering.CommandList
Related Guides
Broader workflow and conceptual references connected to this API.
Constructors
Showing 2 constructors
No results match this filter.
Methods
Showing 75 methods
public void Blit(Sandbox.Material material, Sandbox.RenderAttributes attributes = null)
Parameters
attributes: Default: null
public void ClearRenderTarget()
Set the current render target. Setting this will bind the render target and change the viewport to match it.
public void DispatchComputeIndirect(Sandbox.ComputeShader compute, Sandbox.GpuBuffer indirectBuffer, uint indirectElementOffset = 0)
Parameters
indirectElementOffset: Default: 0
public void Draw(Sandbox.GpuBuffer`1<T> vertexBuffer, Sandbox.Material material, int startVertex = 0, int vertexCount = 0, Sandbox.RenderAttributes attributes = null, Sandbox.Graphics.PrimitiveType primitiveType = 5)
Parameters
startVertex: Default: 0vertexCount: Default: 0attributes: Default: nullprimitiveType: Default: 5
public void DrawIndexed(Sandbox.GpuBuffer`1<T> vertexBuffer, Sandbox.GpuBuffer indexBuffer, Sandbox.Material material, int startIndex = 0, int indexCount = 0, Sandbox.RenderAttributes attributes = null, Sandbox.Graphics.PrimitiveType primitiveType = 5)
Parameters
startIndex: Default: 0indexCount: Default: 0attributes: Default: nullprimitiveType: Default: 5
public void DrawIndexedInstanced(Sandbox.GpuBuffer indexBuffer, Sandbox.Material material, int instanceCount, Sandbox.RenderAttributes attributes = null, Sandbox.Graphics.PrimitiveType primitiveType = 5)
Draws indexed geometry with instancing. Each instance shares the same index buffer.
Parameters
attributes: Default: nullprimitiveType: Default: 5
public void DrawModel(Sandbox.Model model, Transform transform, Sandbox.RenderAttributes attributes = null)
Draws a single model at the given Transform immediately.
Parameters
model: The model to drawtransform: Transform to draw the model atattributes: Optional attributes to apply only for this draw call Default: null
public void DrawModelInstancedIndirect(Sandbox.Model model, Sandbox.GpuBuffer buffer, int bufferOffset = 0, Sandbox.RenderAttributes attributes = null)
Draws multiple instances of a model using GPU instancing with the number of instances being provided by indirect draw arguments. Use `SV_InstanceID` semantic in shaders to access the rendered instance.
Parameters
model: The model to drawbuffer: The GPU buffer containing the DrawIndirectArgumentsbufferOffset: Optional offset in the GPU buffer Default: 0attributes: Optional attributes to apply only for this draw call Default: null
public void DrawReflection(Sandbox.CameraComponent camera, Sandbox.Plane plane, Sandbox.Rendering.RenderTargetHandle target, Sandbox.Rendering.ReflectionSetup reflectionSetup = null)
Render a planar reflection using the specified camera and the specified plane.
Parameters
reflectionSetup: Default: null
public void DrawRefraction(Sandbox.CameraComponent camera, Sandbox.Plane plane, Sandbox.Rendering.RenderTargetHandle target, Sandbox.Rendering.RefractionSetup refractionSetup = null)
Render a planar refraction using the specified camera and the specified plane. This is for all intents and purposes a regular view with a plane clipping it. Usually used for rendering under water.
Parameters
refractionSetup: Default: null
public void DrawRenderer(Sandbox.Renderer renderer, Sandbox.Rendering.RendererSetup rendererSetup = null)
Render a `Sandbox.Renderer` with the specified overrides.
Parameters
rendererSetup: Default: null
public void DrawText(Sandbox.TextRendering.Scope scope, Sandbox.Rect rect, Sandbox.TextFlag flags = 33)
Draws text within a rectangle using a prepared `Sandbox.TextRendering.Scope`.
Parameters
scope: The text rendering scope.rect: The rectangle to draw the text in.flags: Text alignment flags (optional). Default: 33
public void DrawView(Sandbox.CameraComponent camera, Sandbox.Rendering.RenderTargetHandle target, Sandbox.Rendering.ViewSetup viewSetup = null)
Renders the view from a camera to the specified render target.
Parameters
viewSetup: Default: null
public Sandbox.Rendering.RenderTargetHandle GrabDepthTexture(string token)Obsolete
Takes a copy of the depthbuffer and returns a handle to it
Obsolete: This API member is obsolete.
public Sandbox.Rendering.RenderTargetHandle GrabFrameTexture(string token, bool withMips = False)Obsolete
Takes a copy of the framebuffer and returns a handle to it
Obsolete: This API member is obsolete.
Parameters
withMips: Generates mipmaps on the grabbed texture filtered with gaussian blur for each mip Default: False
public void InsertList(Sandbox.Rendering.CommandList otherBuffer)
Run this CommandList here
public void ReleaseRenderTarget(Sandbox.Rendering.RenderTargetHandle handle)
We're no longer using this RT, return it to the pool
public void Reset()
public void SetConstantBuffer(Sandbox.StringToken token, T data)Obsolete
Obsolete: This API member is obsolete.
public Sandbox.Rendering.RenderTargetHandle.SizeHandle ViewportSizeScaled(int divisor)
A handle to the viewport size divided by a factor. Useful for dispatching at half or quarter resolution.
No results match this filter.
Properties
Showing 7 properties
public Sandbox.Rendering.CommandList.AttributeAccess Sandbox.Rendering.CommandList.Attributes { get; set; }
Access to the local attributes. What these are depends on where the command list is being called. If we're calling from a renderable, these are the attributes for that renderable.
public string Sandbox.Rendering.CommandList.DebugName { get; set; }
public bool Sandbox.Rendering.CommandList.Enabled { get; set; }
public Sandbox.Rendering.CommandList.Flag Sandbox.Rendering.CommandList.Flags { get; set; }
public Sandbox.Rendering.CommandList.AttributeAccess Sandbox.Rendering.CommandList.GlobalAttributes { get; set; }
These are the attributes for the current view. Setting a variable here will let you pass it down to other places in the render pipeline.
public Sandbox.Rendering.HudPainter Sandbox.Rendering.CommandList.Paint { get; set; }
Access to simple 2D painting functions to draw shapes and text.
public Sandbox.Rendering.RenderTargetHandle.SizeHandle Sandbox.Rendering.CommandList.ViewportSize { get; set; }
A handle to the viewport size
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Sandbox.Rendering |
| Type | class |
| Assembly | Sandbox.Engine |
| Doc ID | T:Sandbox.Rendering.CommandList |