稀疏纹理 (Sparse Textures)(也称为“区块纹理”或“超级纹理”)是太大而无法完全存入显存的纹理。为了处理它们,Unity 将主纹理分解为更小的矩形部分,称为“区块”(tile)。然后,可根据需要加载各个区块。例如,如果摄像机只能看到稀疏纹理的一小块区域,那么只有当前可见的区块需要加载到内存中。
除了区块特性之外,稀疏纹理的行为与目前所用的任何其他纹理相似。无需进行特殊修改,着色器即可使用它们,而且它们可以有 Mipmap,使用所有纹理过滤模式等。如果由于某种原因无法加载特定的区块,则结果是不明的:有些 GPU 在缺少区块的位置显示黑色区域,但此行为未标准化。
并非所有硬件和平台都支持稀疏纹理。例如,在 DirectX 系统上,它们需要 DX11.2 (Windows 8.1) 以及相当新的 GPU。在 OpenGL 上,它们需要 ARB_sparse_texture 扩展支持。稀疏纹理仅支持非压缩纹理格式。
请参阅 SparseTexture 脚本参考页面,了解有关使用脚本处理稀疏纹理的更多详细信息。
此处提供了稀疏纹理的一个最小示例项目。
该示例显示了一个简单的程序化纹理图案,允许您移动摄像机以查看它的不同部分。请注意,该项目需要最新的 GPU 和 DirectX 11.2 (Windows 8.1) 系统,或者使用支持 ARB_sparse_texture 的 OpenGL。
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.