public struct RenderingData { public CullingResults cullResults; public CameraData cameraData; public LightData lightData; public ShadowData shadowData; public PostProcessingData postProcessingData; public bool supportsDynamicBatching; public PerObjectData perObjectData;
/// <summary> /// True if post-processing effect is enabled while rendering the camera stack. /// </summary> public bool postProcessingEnabled; } public struct LightData { public int mainLightIndex; public int additionalLightsCount; public int maxPerObjectAdditionalLightsCount; public NativeArray<VisibleLight> visibleLights; internal NativeArray<int> originalIndices; public bool shadeAdditionalLightsPerVertex; public bool supportsMixedLighting; public bool reflectionProbeBoxProjection; public bool reflectionProbeBlending; public bool supportsLightLayers;
/// <summary> /// True if additional lights enabled. /// </summary> public bool supportsAdditionalLights; } 其他结构...
ShaderPropertyId定义管线全局需要的Shader内变量PropertyId
1 2 3 4 5 6 7 8 9 10 11 12
internal static class ShaderPropertyId { public static readonly int time = Shader.PropertyToID("_Time"); public static readonly int sinTime = Shader.PropertyToID("_SinTime"); public static readonly int cosTime = Shader.PropertyToID("_CosTime"); public static readonly int deltaTime = Shader.PropertyToID("unity_DeltaTime"); public static readonly int timeParameters = Shader.PropertyToID("_TimeParameters"); public static readonly int viewMatrix = Shader.PropertyToID("unity_MatrixV"); public static readonly int projectionMatrix = Shader.PropertyToID("glstate_matrix_projection"); public static readonly int viewAndProjectionMatrix = Shader.PropertyToID("unity_MatrixVP"); ...其他 }
ShaderKeywordStrings定义管线的shader关键字
1 2 3 4 5 6 7 8
public static class ShaderKeywordStrings { public static readonly string MainLightShadows = "_MAIN_LIGHT_SHADOWS"; public static readonly string MainLightShadowCascades = "_MAIN_LIGHT_SHADOWS_CASCADE"; public static readonly string MainLightShadowScreen = "_MAIN_LIGHT_SHADOWS_SCREEN"; public static readonly string CastingPunctualLightShadow = "_CASTING_PUNCTUAL_LIGHT_SHADOW"; ...其他 }