Optimizing Shader Load Time 优化Shader加载时间
本文档主要是对Unity官方手册的个人理解与总结(其实以翻译记录为主:>)
仅作为个人学习使用,不得作为商业用途,欢迎转载,并请注明出处。
文章中涉及到的操作都是基于Unity2018.3版本
参考链接:https://docs.unity3d.com/Manual/OptimizingShaderLoadTime.html
Shaders are small programs that execute on the GPU, and loading them can take some time. Each individual GPU program typically does not take much time to load, but shaders often have a lot of “variants” internally.
着色器是在GPU上执行的小程序,加载它们需要一些时间。每个单独的GPU程序通常不会花费太多的时间去加载,但是着色器内部通常有很多“变体”。
For example, the Standard shader, if fully compiled, ends up being many thousands of slightly different GPU programs. This creates two potential problems:
例如,标准(Standard ) 着色器,如果完全编译,最终会变成成千上万个稍微不同的GPU程序。这就产生了两个潜在的问题:
- Large numbers of these shader variants increase game build time, and game data size.<

本文探讨了Unity中如何优化Shader加载时间,包括理解Shader变体导致的性能问题,Unity的默认加载行为,以及如何使用ShaderVariantCollection预加载变体,以减少游戏启动时的延迟和内存占用。
最低0.47元/天 解锁文章
1074

被折叠的 条评论
为什么被折叠?



