Version: 2020.3
public Rendering.ScopedSubPass BeginScopedSubPass (NativeArray<int> colors, NativeArray<int> inputs, bool isDepthReadOnly, bool isStencilReadOnly);
public Rendering.ScopedSubPass BeginScopedSubPass (NativeArray<int> colors, NativeArray<int> inputs, bool isDepthStencilReadOnly);
public Rendering.ScopedSubPass BeginScopedSubPass (NativeArray<int> colors, bool isDepthReadOnly, bool isStencilReadOnly);
public Rendering.ScopedSubPass BeginScopedSubPass (NativeArray<int> colors, bool isDepthStencilReadOnly);

参数

colors 用作子通道中颜色渲染器目标的附件数组。这些指定为传递给 BeginRenderPass 的数组中的索引。数组中的值会立即复制。
inputs 用作子通道中输入附件的附件数组。这些指定为传递给 BeginRenderPass 的数组中的索引。数组中的值会立即复制。
isDepthStencilReadOnly If true, both depth and stencil attachments are read-only in this sub pass. Some renderers require this in order to be able to use the depth and stencil attachments as inputs.
isDepthReadOnly 如果为 true,则子通道中的深度附件为只读。有些渲染器要求这样设置,以便能够将深度附件用作输入。
isStencilReadOnly If true, the stencil attachment is read-only in this sub pass. Some renderers require this in order to be able to use the stencil attachment as input.

描述

调度渲染通道中的新子通道的开头。如果在 using 语句调用此内容,则 Unity 会在退出 using 代码块时自动调用 EndSubPass。 渲染通道永远不能独立存在,必须始终包含至少一个子通道。在任何时候只能有一个子通道处于活动状态。

此方法执行的操作与 BeginSubPass 相同,但是它会返回可以在 using 语句中使用的 IDisposable,因此无需手动调用 EndSubPass

另请参阅:BeginScopedRenderPass