有时,Unity 无法使用常规 着色器在 GPU 上运行的程序。 更多信息
请参阅 术语表 渲染物体。发生这种情况时,Unity 会使用特殊着色器渲染物体
Unity 使用的特殊着色器取决于 Unity 无法使用原始着色器的具体原因。
当物体的材质或着色器出现问题时,Unity 会使用默认错误着色器渲染该物体;例如,如果未分配材质,如果着色器未编译,或如果着色器不受支持。
Unity 在 Unity 编辑器和构建中使用默认错误着色器。
默认错误着色器为品红色(亮粉色)。
当您使用 BatchRendererGroup API 时,Unity 不会显示默认错误着色器。使用 BatchRendererGroup.SetErrorMaterial 设置要使用的替代材质。
如果您的项目使用通用渲染管线 (URP),如果物体使用内置 渲染管线一系列操作,将场景内容显示在屏幕上。Unity 允许您选择预构建的渲染管线,或编写您自己的渲染管线。 更多信息
请参阅 术语表 的着色器,Unity 可能会使用默认错误着色器渲染物体。有关更多信息,请参阅 转换您的着色器。
Unity 使用加载着色器渲染物体,表示 Unity 正在编译显示该物体所需的 着色器变体根据特定着色器关键字组合及其状态生成的着色器程序版本。着色器对象可以包含多个着色器变体。 更多信息
请参阅 术语表。
当 异步着色器编译 启用时,或在 开发版本开发版本包含调试符号并启用 Profiler。 更多信息
请参阅 术语表 中启用 着色器实时链接支持 时,Unity 在 Unity 编辑器中显示加载着色器。
加载着色器为青色(亮蓝色)。
当您使用 BatchRendererGroup API 时,Unity 不会显示加载着色器。使用 BatchRendererGroup.SetLoadingMaterial 设置要使用的替代材质。
如果您的项目使用 流式虚拟纹理 (SVT),Unity 使用特殊材质来指示 SVT 设置中的问题。有关更多信息,请参阅 虚拟纹理错误材质。
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.