示例#1
0
    void DefaultRenderFlow(ScriptableRenderContext context, Camera camera)
    {
        ScriptableCullingParameters cullingParameters;

        if (!camera.TryGetCullingParameters(out cullingParameters))
        {
            return;
        }

#if UNITY_EDITOR
        if (camera.cameraType == CameraType.SceneView)
        {
            ScriptableRenderContext.EmitWorldGeometryForSceneView(camera);
        }
#endif

        cullingParameters.shadowDistance = Mathf.Min(setting.shadow.maxDistance, camera.farClipPlane);

        CmdBuff.BeginSample(camera.name);

        cullingResults = context.Cull(ref cullingParameters);

        SetShadow(context, camera);

        SetCamera(context, camera);

        ClearRenderBuffer(context, camera);

        SetLighting(context, camera);

        DrawDepthOnly(context, camera);

        DrawOpaque(context, camera);

        DrawSky(context, camera);

#if UNITY_EDITOR
        if (UnityEditor.Handles.ShouldRenderGizmos())
        {
            context.DrawGizmos(camera, GizmoSubset.PreImageEffects);
        }
#endif

#if UNITY_EDITOR
        if (UnityEditor.Handles.ShouldRenderGizmos())
        {
            context.DrawGizmos(camera, GizmoSubset.PostImageEffects);
        }
#endif

        CmdBuff.EndSample(camera.name);
        context.ExecuteCommandBuffer(CmdBuff);
        CmdBuff.Clear();
    }
示例#2
0
    void CustomRenderFlow(ScriptableRenderContext context, Camera camera)
    {
        ScriptableCullingParameters cullingParameters;

        if (!camera.TryGetCullingParameters(out cullingParameters))
        {
            return;
        }

        cullingParameters.shadowDistance = Mathf.Min(setting.shadow.maxDistance, camera.farClipPlane);

        CmdBuff.BeginSample(camera.name);

        cullingResults = context.Cull(ref cullingParameters);

        SetShadow(context, camera);

        SetCamera(context, camera);

        ClearRenderBuffer(context, camera);

        SetRenderBuffer(context, camera);

        SetLighting(context, camera);

        DrawDepthOnly(context, camera);

        DrawOpaque(context, camera);

        DrawSky(context, camera);

        Flip(context, camera);

        CmdBuff.EndSample(camera.name);
        context.ExecuteCommandBuffer(CmdBuff);
        CmdBuff.Clear();
    }