class in UnityEngine.Experimental.Rendering
This utility class contains helper functions that enable you to query properties of a TextureFormat, RenderTextureFormat, or GraphicsFormat. This class also includes format conversion and size calculation functions.
ComputeMipChainSize | Computes the memory size in bytes for a chain of mipmaps. |
ComputeMipmapSize | Computes the memory size in bytes for a single mipmap. |
ConvertToAlphaFormat | Input a GraphicsFormat to return an equivalent GraphicsFormat that includes an alpha component. |
GetAlphaComponentCount | 返回该格式的 Alpha 分量数。 |
GetBlockHeight | 返回纹素块的高度(以纹素为单位)。 |
GetBlockSize | Returns the memory size in bytes of a texel block. |
GetBlockWidth | 返回纹素块的宽度(以纹素为单位)。 |
GetColorComponentCount | 返回该格式的颜色分量数。 |
GetComponentCount | Returns the number of components this format has. |
GetDepthBits | Returns the number of bits per pixel this format contains for depth. |
GetDepthStencilFormat | Returns a supported depth stencil format that has 'minimumDepthBits' of bits or higher per pixel for the depth component if a compatible format exists on the current platform. If 'minimumStencilBits' is higher than 0, and a compatible format exists on the current platform, Unity returns a depth stencil format with 8 bits per pixel for the stencil component. |
GetFormatString | Returns a string that represents a format enum value. |
GetGraphicsFormat | 将 RenderTextureFormat 或 TextureFormat 转换为 GraphicsFormat。 |
GetLinearFormat | 返回 GraphicsFormat 的等效线性格式。例如,如果输入为 kFormatR8G8B8A8_SRGB,则该函数返回 kFormatR8G8B8A8_UNorm。如果输入 GraphicsFormat 已经是线性的,则该函数返回输入 GraphicsFormat。 |
GetRenderTextureFormat | 将 GraphicsFormat 转换为 RenderTextureFormat。 |
GetSRGBFormat | 返回 GraphicsFormat 的等效 sRGB 格式。例如,如果输入为 kFormatR8G8B8A8_UNorm,则该函数返回 kFormatR8G8B8A8_SRGB。如果输入 GraphicsFormat 已经是 sRGB,则该函数返回输入 GraphicsFormat。如果没有等效 sRGB 格式,则该函数返回输入 GraphicsFormat。 |
GetSwizzleA | Returns a FormatSwizzle enum that is mapped to the alpha channel for a given format. |
GetSwizzleB | Returns a FormatSwizzle enum that is mapped to the blue channel for a given format. |
GetSwizzleG | Returns a FormatSwizzle enum that is mapped to the green channel for a given format. |
GetSwizzleR | 返回其通道被映射到给定格式的 R 通道的 FormatSwizzle 枚举。 |
GetTextureFormat | 将 GraphicsFormat 转换为 TextureFormat。 |
HasAlphaChannel | 如果该格式具有 Alpha 分量,则返回 true。否则返回 false。 |
Is16BitPackedFormat | 如果该格式为打包格式并具有 16 位格式,则返回 true。否则返回 false。 |
IsAlphaOnlyFormat | 如果该格式仅具有 Alpha 分量,则返回 true。否则返回 false。 |
IsAlphaTestFormat | 如果该格式仅具有只有 1 或 2 个位的 Alpha 分量,则返回 true。否则返回 false。 |
IsASTCFormat | 如果该格式使用 ASTC,则返回 true。否则返回 false。 |
IsBCFormat | 如果该格式为 DXTC、RGTC 或 BPTC 格式,则返回 true。否则返回 false。 |
IsBPTCFormat | 如果该格式使用 BPTC,则返回 true。否则返回 false。 |
IsCompressedFormat | 如果该格式为压缩格式,则返回 true。否则返回 false。 |
IsCrunchFormat | Returns true if the format data is compressed with Crunch. Returns false otherwise. |
IsDepthFormat | 如果该格式为深度格式,则返回 true。否则返回 false。 |
IsDepthStencilFormat | Returns true if the format is a depth or stencil format. Returns false otherwise. |
IsDXTCFormat | 如果该格式使用 DXTC,则返回 true。否则返回 false。 |
IsEACFormat | 如果该格式使用 EAC,则返回 true。否则返回 false。 |
IsETCFormat | 如果该格式使用 ETC 和 ETC2,则返回 true。否则返回 false。 |
IsFloatFormat | 如果该格式为单精度浮点格式,则返回 true。否则返回 false。 |
IsHalfFormat | 如果该格式为半精度浮点格式,则返回 true。否则返回 false。 |
IsHDRFormat | Returns true if the format is capable of representing HDR data. Returns false otherwise. |
IsIEEE754Format | 如果该格式为浮点格式,则返回 true。否则返回 false。 |
IsIntegerFormat | 如果该格式为整数格式,则返回 true。否则返回 false。 |
IsNormFormat | 如果该格式为归一化格式,则返回 true。否则返回 false。 |
IsPackedFormat | 如果该格式为打包格式,则返回 true。否则返回 false。 |
IsPVRTCFormat | 如果该格式使用 PVRTC,则返回 true。否则返回 false。 |
IsRGTCFormat | 如果该格式使用 RGTC,则返回 true。否则返回 false。 |
IsSignedFormat | 如果该格式为有符号格式,则返回 true。否则返回 false。 |
IsSIntFormat | 如果该格式为有符号整数格式,则返回 true。否则返回 false。 |
IsSNormFormat | 如果该格式为有符号归一化格式,则返回 true。否则返回 false。 |
IsSRGBFormat | 如果该格式在读取时执行 sRGB 到线性转换并在写入时执行线性到 sRGB 转换,则返回 true。否则返回 false。 |
IsStencilFormat | 如果该格式为模板格式,则返回 true。否则返回 false。 |
IsSwizzleFormat | 如果该格式不是 RGBA 格式,则返回 true。否则返回 false。 |
IsUIntFormat | 如果该格式为无符号整数格式,则返回 true。否则返回 false。 |
IsUNormFormat | 如果该格式为无符号归一化格式,则返回 true。否则返回 false。 |
IsUnsignedFormat | 如果该格式为无符号格式,则返回 true。否则返回 false。 |
IsXRFormat | 如果该格式为扩展范围格式,则返回 true。对于扩展范围格式,蓝色、绿色和红色分量采用线性编码,它们的值范围从 0.752941 到 1.25098。在采样、渲染和写入操作中,Alpha 分量始终限制为 [0.0, 1.0] 范围,尽管支持此范围之外的值。否则返回 false。 |
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.