标志设置,这些标志控制新创建的 RenderTexture 的状态。
MipMap | 设置此标志可在 RenderTexture 中分配多级渐进纹理。有关更多详细信息,请参阅 RenderTexture.useMipMap。 |
AutoGenerateMips | 确定当 RenderTexture 发生修改时是否自动生成多级渐进纹理。 此标志是默认设置的,未同时设置 RenderTextureCreationFlags.MipMap 标志时将不起作用。 有关更多详细信息,请参阅 RenderTexture.autoGenerateMips。 |
SRGB | 如果设置此标志,对此纹理的读写将转换到 SRGB 颜色空间。有关更多详细信息,请参阅 RenderTexture.sRGB。 |
EyeTexture | 当纹理用作 VR 眼睛纹理时,使用此标志。此标志默认已清除。当从 GetDefaultVREyeTextureDesc 或其他返回 RenderTextureDesc 的 VR 函数返回 RenderTextureDesc 时,对 RenderTextureDesc 设置此标志。 |
EnableRandomWrite | 设置此标志可启用从着色器对 RenderTexture 的随机访问写入。 正常情况下,像素着色器只对给定的像素操作。没有此标志,计算着色器不能写入纹理。随机写入允许着色器写入 RenderTexture 的任意位置。有关更多详细信息(包括支持的平台),请参阅 RenderTexture.enableRandomWrite。 |
CreatedFromScript | 从脚本创建 RenderTexture 时,始终在内部设置此标志。从脚本代码手动设置时,此标志将不起作用。 |
AllowVerticalFlip | 当 RenderTexture 是 VR 眼睛纹理并且设备不支持显示时自动翻转纹理时,清除此标志。这是特定于平台的属性, 该属性是默认设置的。仅当从 GetDefaultVREyeTextureDesc 或其他返回 RenderTextureDesc 的 VR 函数返回部分 RenderTextureDesc 时,才清除此标志。目前,只有 Hololens 眼睛纹理需要清除此标志。 |
NoResolvedColorSurface | 如果设置此标志,引擎将不会自动解析颜色表面。 |
DynamicallyScalable | 如果目标平台/图形 API 支持动态分辨率,设置此标志以标记 RenderTexture 支持动态分辨率。有关更多详细信息,请参阅 ScalabeBufferManager。 |
BindMS | 设置此标志会使 RenderTexture 绑定为着色器中的多重采样纹理。当 RenderTexture.antiAliasing 大于 1 时,该标志会阻止 RenderTexture 被默认解析。 |
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.