Version: 2022.2

RenderTextureDescriptor

struct in UnityEngine

切换到手册

描述

This struct contains all the information required to create a RenderTexture. It can be copied, cached, and reused to easily create RenderTextures that all share the same properties. Avoid using the default constructor as it does not initialize some flags with the recommended values.

变量

autoGenerateMips如果设置了该标志,则自动生成多级渐进纹理级别。
bindMS如果为 true 且 msaaSamples 大于 1,则默认不解析渲染纹理。如果需要将渲染纹理绑定为着色器中的多采样纹理,请使用此属性。
colorFormatThe format of the RenderTarget is expressed as a RenderTextureFormat. Internally, this format is stored as a GraphicsFormat compatible with the current system (see SystemInfo.GetCompatibleFormat). Therefore, if you set a format and immediately get it again, it may return a different result from the one just set.
depthBufferBitsThe precision of the render texture's depth buffer in bits (0, 16, 24 and 32 are supported).
depthStencilFormatThe desired format of the depth/stencil buffer.
dimension渲染纹理的维度(类型)。另请参阅:RenderTexture.dimension。
enableRandomWrite在 Shader Model 5.0 级别着色器上启用随机访问写入该渲染纹理。另请参阅:RenderTexture.enableRandomWrite。
flags一组 RenderTextureCreationFlags,控制纹理的创建方式。
graphicsFormatThe color format for the RenderTexture. You can set this format to None to achieve depth-only rendering.
height渲染纹理的高度(以像素为单位)。
memoryless渲染纹理无记忆模式属性。
mipCount用户定义的 Mipmap 数量。
msaaSamplesRenderTexture 的多采样抗锯齿级别。另请参阅:RenderTexture.antiAliasing。
shadowSamplingMode确定当 RenderTexture 用作阴影贴图时的采样方式。另请参阅:ShadowSamplingMode,以了解更多详细信息。
sRGB此标志会使渲染纹理使用 sRGB 读/写转换。
stencilFormatThe format of the stencil data that you can encapsulate within a RenderTexture.Specifying this property creates a stencil element for the RenderTexture and sets its format. This allows for stencil data to be bound as a Texture to all shader types for the platforms that support it. This property does not specify the format of the stencil buffer, which is constrained by the depth buffer format specified in RenderTexture.depth.Currently, most platforms only support R8_UInt (DirectX11, DirectX12), while PS4 also supports R8_UNorm.
useDynamicScale设置为 true 可在此渲染纹理上启用动态分辨率缩放。另请参阅:RenderTexture.useDynamicScale。
useMipMap如果设置该标志,则渲染纹理具有多级渐进纹理。另请参阅:RenderTexture.useMipMap。
volumeDepth3D 渲染纹理的体积范围。
vrUsage如果该 RenderTexture 是在立体渲染中使用的 VR 眼睛纹理,则该属性决定将进行哪些特殊渲染(如果有)。不必手动设置此属性,它会使用 eyeTextureDesc 或其他返回 RenderTextureDescriptor 的 VR 函数返回的值。
width渲染纹理的宽度(以像素为单位)。

构造函数

RenderTextureDescriptor使用默认值或特定宽度、高度和格式创建 RenderTextureDescriptor。
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961