ScriptableRenderContext.DrawRenderers 的设置。
DrawingSettings 描述了如何对可见对象进行排序 (sortingSettings) 以及使用哪些着色器通道 (shaderPassName)。
其他资源: ScriptableRenderContext.DrawRenderers、ScriptableRenderContext.Cull、FilteringSettings。
OverrideMaterial 与 OverrideShader: 使用 overrideMaterial 参数将覆盖所有渲染的材质及其属性。overrideShader 属性将强制渲染器使用其他着色器,同时保留当前材质属性。然后可以在 override 着色器中访问覆盖材质上的属性。目前,SRPBatcher 和 BatchRendererGroups 不支持使用 override 着色器。Override 着色器会对性能产生影响,应避免在可以使用 overrideMaterial 的情况下使用。OverrideShader 和 OverrideMaterial 不能在同一个 drawRenderers 调用中使用。
maxShaderPasses | 在一个 DrawRenderers 调用中可以渲染的最大通道数。 |
enableDynamicBatching | 控制是否启用动态批处理。 |
enableInstancing | 控制是否启用实例化。 |
fallbackMaterial | 设置用于此组中不符合要求的所有绘制器的材质。 |
mainLightIndex | 配置应使用哪个光源作为主光源。 |
overrideMaterial | 设置用于此组中所有将要渲染的绘制器的材质。 |
overrideMaterialPassIndex | 选择要使用的覆盖材质的通道。 |
overrideShader | 设置用于此组中所有将要渲染的绘制器的着色器。Override 着色器不会覆盖现有的材质属性。 |
overrideShaderPassIndex | 选择要使用的覆盖着色器的通道。 |
perObjectData | 在渲染过程中设置哪种类型的每个对象数据。 |
sortingSettings | 在渲染过程中如何对对象进行排序。 |
DrawingSettings | 创建绘制设置结构体。 |
GetShaderPassName | 获取着色器通道的名称。 |
SetShaderPassName | 设置着色器通道的名称。 |
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.