rt | 为颜色和深度缓冲区设置的渲染目标。 |
color | 设置为颜色缓冲区的渲染目标。 |
colors | 设置为颜色缓冲区的渲染目标 (MRT)。 |
depth | 设置为深度缓冲区的渲染目标。 |
mipLevel | 渲染目标的要达到的 Mip 级别。 |
cubemapFace | 立方体贴图渲染目标要渲染到的立方体贴图面。 |
depthSlice | 要设置的 3D 或数组渲染目标的切片。 |
loadAction | Load action that is used for color and depth/stencil buffers. |
storeAction | Store action that is used for color and depth/stencil buffers. |
colorLoadAction | Load action that is used for the color buffer. |
colorStoreAction | Store action that is used for the color buffer. |
depthLoadAction | Load action that is used for the depth/stencil buffer. |
depthStoreAction | Store action that is used for the depth/stencil buffer. |
添加“设置活动的渲染目标”命令。
可通过若干种方式指示要使用的渲染纹理:RenderTexture 对象、用 GetTemporaryRT 创建的临时渲染纹理或内置的临时纹理之一 (BuiltinRenderTextureType)。上述所有形式的渲染纹理都用 RenderTargetIdentifier 结构来表示,该结构使用隐式转换运算符,实现键入时保存。
在命令缓冲区执行期间,不必显式保留活动的渲染目标(当前的渲染目标将被保存并在之后恢复)。
Variations of this method are available which take extra arguments such as mipLevel (int) and cubemapFace to enable rendering into a specific mipmap level of a RenderTexture, or specific cubemap face of a cubemap RenderTexture.
Overloads setting a single RenderTarget and without explicit mipLevel, cubemapFace and depthSlice respect the mipLevel, cubemapFace and depthSlice values that were specified when creating the RenderTargetIdentifier.
Overloads setting multiple render targets will set mipLevel, cubemapFace, and depthSlice to 0, Unknown, and 0 unless otherwise specified.
请注意,在线性颜色空间中,设置正确的 sRGB<-> 线性颜色转换
状态非常重要。受之前渲染的内容的影响,当前状态可能不是您预期的状态。
您应考虑在执行 SetRenderTarget 或任何其他手动渲染之前,将 GL.sRGBWrite 设置为
需要的值。
Rendering.RenderTargetIdentifier.Clear is currently not supported. A subsequent call to ClearRenderTarget has the same effect and is optimized on graphics APIs that support clear
load actions.
另请参阅:GetTemporaryRT、ClearRenderTarget、Blit、RenderTargetIdentifier。