CommandListclass
Constructors2
Showing 2 constructors
No results match this filter.
Methods78
Showing 78 methods
public void Blit(Sandbox.Material material, Sandbox.RenderAttributes attributes = null)
| Parameter | Type | Description |
|---|---|---|
| material | Material | — |
| attributes = null | RenderAttributes | — |
void—public void ClearRenderTarget()
Set the current render target. Setting this will bind the render target and change the viewport to match it.
void—public void DispatchComputeIndirect(Sandbox.ComputeShader compute, Sandbox.GpuBuffer indirectBuffer, uint indirectElementOffset = 0)
| Parameter | Type | Description |
|---|---|---|
| compute | ComputeShader | — |
| indirectBuffer | GpuBuffer | — |
| indirectElementOffset = 0 | uint | — |
void—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)
| Parameter | Type | Description |
|---|---|---|
| vertexBuffer | GpuBuffer<T> | — |
| material | Material | — |
| startVertex = 0 | int | — |
| vertexCount = 0 | int | — |
| attributes = null | RenderAttributes | — |
| primitiveType = 5 | PrimitiveType | — |
void—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)
| Parameter | Type | Description |
|---|---|---|
| vertexBuffer | GpuBuffer<T> | — |
| indexBuffer | GpuBuffer | — |
| material | Material | — |
| startIndex = 0 | int | — |
| indexCount = 0 | int | — |
| attributes = null | RenderAttributes | — |
| primitiveType = 5 | PrimitiveType | — |
void—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.
| Parameter | Type | Description |
|---|---|---|
| indexBuffer | GpuBuffer | — |
| material | Material | — |
| instanceCount | int | — |
| attributes = null | RenderAttributes | — |
| primitiveType = 5 | PrimitiveType | — |
void—public void DrawModel(Sandbox.Model model, Transform transform, Sandbox.RenderAttributes attributes = null)
Draws a single model at the given Transform immediately.
| Parameter | Type | Description |
|---|---|---|
| model | Model | The model to draw |
| transform | Transform | Transform to draw the model at |
| attributes = null | RenderAttributes | Optional attributes to apply only for this draw call |
void—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.
| Parameter | Type | Description |
|---|---|---|
| model | Model | The model to draw |
| buffer | GpuBuffer | The GPU buffer containing the DrawIndirectArguments |
| bufferOffset = 0 | int | Optional offset in the GPU buffer |
| attributes = null | RenderAttributes | Optional attributes to apply only for this draw call |
void—public void DrawQuad(Sandbox.Rect rect, Sandbox.Material material, Color color)
| Parameter | Type | Description |
|---|---|---|
| rect | Rect | — |
| material | Material | — |
| color | Color | — |
void—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.
| Parameter | Type | Description |
|---|---|---|
| camera | CameraComponent | — |
| plane | Plane | — |
| target | RenderTargetHandle | — |
| reflectionSetup = null | ReflectionSetup | — |
void—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.
| Parameter | Type | Description |
|---|---|---|
| camera | CameraComponent | — |
| plane | Plane | — |
| target | RenderTargetHandle | — |
| refractionSetup = null | RefractionSetup | — |
void—public void DrawRenderer(Sandbox.Renderer renderer, Sandbox.Rendering.RendererSetup rendererSetup = null)
Render a `Sandbox.Renderer` with the specified overrides.
| Parameter | Type | Description |
|---|---|---|
| renderer | Renderer | — |
| rendererSetup = null | RendererSetup | — |
void—public void DrawScreenQuad(Sandbox.Material material, Color color)
| Parameter | Type | Description |
|---|---|---|
| material | Material | — |
| color | Color | — |
void—public void DrawText(Sandbox.TextRendering.Scope scope, Sandbox.Rect rect, Sandbox.TextFlag flags = 33, float angleDegrees = 0)
Draws text within a rectangle using a prepared `Sandbox.TextRendering.Scope`.
| Parameter | Type | Description |
|---|---|---|
| scope | Scope | The text rendering scope. |
| rect | Rect | The rectangle to draw the text in. |
| flags = 33 | TextFlag | Text alignment flags (optional). |
| angleDegrees = 0 | float | Rotation angle in degrees (optional). |
void—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.
| Parameter | Type | Description |
|---|---|---|
| camera | CameraComponent | — |
| target | RenderTargetHandle | — |
| viewSetup = null | ViewSetup | — |
void—public Sandbox.Rendering.RenderTargetHandle GrabDepthTexture(string token)
Takes a copy of the depthbuffer and returns a handle to it
Obsolete: This API member is obsolete.
| Parameter | Type | Description |
|---|---|---|
| token | string | — |
public Sandbox.Rendering.RenderTargetHandle GrabFrameTexture(string token, bool withMips = False)
Takes a copy of the framebuffer and returns a handle to it
Obsolete: This API member is obsolete.
| Parameter | Type | Description |
|---|---|---|
| token | string | — |
| withMips = False | bool | Generates mipmaps on the grabbed texture filtered with gaussian blur for each mip |
public void InsertList(Sandbox.Rendering.CommandList otherBuffer)
Run this CommandList here
| Parameter | Type | Description |
|---|---|---|
| otherBuffer | CommandList | — |
void—public void ReleaseRenderTarget(Sandbox.Rendering.RenderTargetHandle handle)
We're no longer using this RT, return it to the pool
| Parameter | Type | Description |
|---|---|---|
| handle | RenderTargetHandle | — |
void—public void Reset()
void—public void SetConstantBuffer(Sandbox.StringToken token, T data)
Obsolete: This API member is obsolete.
| Parameter | Type | Description |
|---|---|---|
| token | StringToken | — |
| data | T | — |
void—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.
| Parameter | Type | Description |
|---|---|---|
| divisor | int | — |
No results match this filter.
Properties7
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; }
string—public bool Sandbox.Rendering.CommandList.Enabled { get; set; }
bool—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.
Obsolete: Global/frame attributes are deprecated. Use a local Attributes set or pipeline texture slots instead.
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.