//渲染设置struct DrawingSettings{bool enableDynamicBatching;//是否动态渲染。bool enableInstancing;//是否实例渲染。int mainLightIndex;//配置哪个灯光作为主光源。Material overrideMaterial;// Sets the Material to use for all drawers that would render in this group.int overrideMaterialPassIndex;// Selects which pass of the override material to use.PerObjectData perObjectData;//在渲染时给每个物体设置的参数(系统内置参数)。SortingSettings sortingSettings;//在渲染时如何排序物体。}//这些参数可以叠加enum PerObjectData{
None,//Do not setup any particular per-object data besides the transformation matrix.
LightProbe,//Setup per-object light probe SH data.
ReflectionProbes,//Setup per-object reflection probe data.
LightProbeProxyVolume,//Setup per-object light probe proxy volume data.
Lightmaps,//Setup per-object lightmaps.
LightData,//Setup per-object light data.
MotionVectors,//Setup per-object motion vectors.
LightIndices,//Setup per-object light indices.
ReflectionProbeData,//Setup per-object reflection probe index offset and count.
OcclusionProbe,//Setup per-object occlusion probe data.
OcclusionProbeProxyVolume,//Setup per-object occlusion probe proxy volume data (occlusion in alpha channels).
ShadowMask,//Setup per-object shadowmask.}//排序设置struct SortingSettings{Vector3 cameraPosition;//Used to calculate the distance to objects.SortingCriteria criteria;//What kind of sorting to do while rendering.Vector3 customAxis;//Used to calculate distance to objects, by comparing the positions of objects to this axis.DistanceMetric distanceMetric;//Type of sorting to use while rendering.Matrix4x4 worldToCameraMatrix;//Used to calculate the distance to objects.}//排序方式enum SortingCriteria{
None,//不排序。
SortingLayer,//Sort by renderer sorting layer.
RenderQueue,//按照材质渲染队列排序。
BackToFront,//从后到钱排序。
QuantizedFrontToBack,//Sort objects in rough front-to-back buckets.
OptimizeStateChanges,//对物体排序来减少渲染状态的更改。
CanvasOrder,//根据画布顺序对物体排序。
RendererPriority,//根据物体优先级排序。
CommonOpaque,//不透明物体经典排序。
CommonTransparent,//透明物体经典排序。}//排序方式enum DistanceMetric{
Perspective,//沿着相机位置到物体中心点的距离排序。
Orthographic,//根据沿相机视图方向的距离进行排序。
CustomAxis,//沿着自定义方向排序(相机空间)。}//过滤模式struct FilterSettings{bool excludeMotionVectorObjects,//Set to true to exclude objects that are currently in motion from rendering. The default value is false.int layerMask,//Only render objects in the given layer mask.int renderingLayerMask,//The rendering layer mask to use when filtering available renderers for drawing.RenderQueueRange renderQueueRange,//Render objects whose material render queue in inside this range.SortingLayerRange sortingLayerRange,//Render objects whose sorting layer is inside this range.}