此结构包含创建 RenderTexture 需要的所有信息。可以复制、缓存和重用来轻松创建全部共享相同属性的 RenderTexture。
autoGenerateMips | 如果设置了该标志,则自动生成多级渐进纹理级别。 |
bindMS | 如果为 true 且 msaaSamples 大于 1,则默认不解析渲染纹理。如果需要将渲染纹理绑定为着色器中的多采样纹理,请使用此属性。 |
depthBufferBits | 渲染纹理深度缓冲区的精度(以位为单位,支持 0、16、24/32 位)。另请参阅:RenderTexture.depth。 |
dimension | 渲染纹理的维度(类型)。另请参阅:RenderTexture.dimension。 |
enableRandomWrite | 在 Shader Model 5.0 级别着色器上启用随机访问写入该渲染纹理。另请参阅:RenderTexture.enableRandomWrite。 |
flags | 一组 RenderTextureCreationFlags,控制纹理的创建方式。 |
graphicsFormat | RenderTexture 的颜色格式。 |
height | 渲染纹理的高度(以像素为单位)。 |
memoryless | 渲染纹理无记忆模式属性。 |
mipCount | 用户定义的 Mipmap 数量。 |
msaaSamples | RenderTexture 的多采样抗锯齿级别。另请参阅:RenderTexture.antiAliasing。 |
shadowSamplingMode | 确定当 RenderTexture 用作阴影贴图时的采样方式。另请参阅:ShadowSamplingMode,以了解更多详细信息。 |
sRGB | 此标志会使渲染纹理使用 sRGB 读/写转换。 |
stencilFormat | The 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。 |
volumeDepth | 3D 渲染纹理的体积范围。 |
vrUsage | 如果该 RenderTexture 是在立体渲染中使用的 VR 眼睛纹理,则该属性决定将进行哪些特殊渲染(如果有)。不必手动设置此属性,它会使用 eyeTextureDesc 或其他返回 RenderTextureDescriptor 的 VR 函数返回的值。 |
width | 渲染纹理的宽度(以像素为单位)。 |
RenderTextureDescriptor | 使用默认值或特定宽度、高度和格式创建 RenderTextureDescriptor。 |
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.