Version: 2023.1

DrawingSettings

struct in UnityEngine.Rendering

切换到手册

描述

ScriptableRenderContext.DrawRenderers 的设置。

DrawingSettings describes how to sort visible objects (sortingSettings) and which shader passes to use (shaderPassName).

另请参阅:ScriptableRenderContext.DrawRenderers、ScriptableRenderContext.CullFilteringSettings

OverrideMaterial vs. OverrideShader: Using the overrideMaterial parameter will override all rendered materials and their properties. The overrideShader property will force the renderers to use a different shader while preserving current material properties. Properties on the overriden material can then be accessed in the override shader. The use of override shaders is currently not supported with SRPBatcher and BatchRendererGroups. Override Shaders will have an impact on performance and should be avoided where overrideMaterial can be used. OverrideShader and OverrideMaterial can't both be used in the same drawRenderers call.

静态变量

maxShaderPasses在 1 次 DrawRenderers 调用中可渲染的最大通道数。

变量

enableDynamicBatching控制是否启用动态批处理。
enableInstancing控制是否启用实例化。
fallbackMaterialSets the Material to use for any drawers in this group that don't meet the requirements.
mainLightIndex配置应将什么光源用作主光源。
overrideMaterial设置材质以用于将在此组中渲染的所有渲染器。
overrideMaterialPassIndex选择要使用哪个覆盖材质通道。
overrideShaderSets the shader to use for all drawers that would render in this group. Override shaders do not override existing material properties.
overrideShaderPassIndexSelects which pass of the override shader to use.
perObjectData要在渲染期间设置的每对象数据的类型。
sortingSettings如何在渲染期间对对象进行排序。

构造函数

DrawingSettings创建绘制设置结构。

公共函数

GetShaderPassNameGet the name of the shader pass.
SetShaderPassNameSet the name of the shader pass.