Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


AttachmentDescriptor

A declaration of a single color or depth rendering surface to be attached into a RenderPass.
Read time 2 minutesLast updated 4 days ago

Definition

public struct AttachmentDescriptor : IEquatable<AttachmentDescriptor>

Remarks

A AttachmentDescriptor object identifies a single color or depth rendering surface that can be used with a RenderPass. Note that the AttachmentDescriptor object derives from UnityEngine.Object so they do not get garbage collected like normal C# objects. Instead, they are only GC'd when unloading a Scene or when Resources.UnloadUnusedAssets() is called. Therefore do not create these objects each frame: Instead, create these objects in the constructor of your rendering class, and reuse those objects each frame.

Constructors

Constructor

Description

AttachmentDescriptor(UnityEngine.Experimental.Rendering.GraphicsFormat)Create a AttachmentDescriptor to be used with RenderPass.
AttachmentDescriptor(UnityEngine.RenderTextureFormat)Create a AttachmentDescriptor to be used with RenderPass.
AttachmentDescriptor(UnityEngine.RenderTextureFormat,UnityEngine.Rendering.RenderTargetIdentifier,System.Boolean,System.Boolean,System.Boolean)Create a AttachmentDescriptor to be used with RenderPass.

Properties

Property

Description

clearColorThe currently assigned clear color for this attachment. Default is black.
clearDepthCurrently assigned depth clear value for this attachment. Default value is 1.0.
clearStencilCurrently assigned stencil clear value for this attachment. Default is 0.
formatThe format of this attachment.
graphicsFormatThe GraphicsFormat of this attachment. To use in place of format.
loadActionThe load action to be used on this attachment when the RenderPass starts.
loadStoreTargetThe surface to use as the backing storage for this AttachmentDescriptor.
resolveTargetWhen the renderpass that uses this attachment ends, resolve the MSAA surface into the given target.
storeActionThe store action to use with this attachment when the RenderPass ends. Only used when either AttachmentDescriptor.ConfigureTarget or AttachmentDescriptor.ConfigureResolveTarget has been called.

Methods

Method

Description

ConfigureClearWhen the RenderPass starts, clear this attachment into the color or depth/stencil values given (depending on the format of this attachment). Changes AttachmentDescriptor.loadAction to RenderBufferLoadAction.Clear.
ConfigureResolveTargetWhen the renderpass that uses this attachment ends, resolve the MSAA surface into the given target.
ConfigureTargetBinds this AttachmentDescriptor to the given target surface.