unity post processing stack v2——代码结构分析

PostProcessLayer.cs

#if UNITY_2019_1_OR_NEWER
        // We always use a CommandBuffer to blit to the final render target
        // OnRenderImage is used only to avoid the automatic blit from the RenderTexture of Camera.forceIntoRenderTexture to the actual target
        [ImageEffectUsesCommandBuffer]
        void OnRenderImage(RenderTexture src, RenderTexture dst)
        {
     
            if (finalBlitToCameraTarget)
                RenderTexture.active = dst; // silence warning
            else
                Graphics.Blit(src, dst);
        }
#endif

属性:ImageEffectUsesCommandBuffer
https://docs.unity3d.com/2019.1/Documentation/ScriptReference/ImageEffectUsesCommandBuffer.html
unity post processing stack v2——代码结构分析_第1张图片
Camera的强制输出到:RenderTexture
Camera.forceIntoRenderTexture
https://docs.unity3d.com/ScriptReference/Camera-forceIntoRenderTexture.html
unity post processing stack v2——代码结构分析_第2张图片

UpdateVolumeSystem——设置参数
public void Render(PostProcessRenderContext context)——绘制
绘制分为三个步骤:
1、内置的
2、嵌入的
3、最后一个pass

unity post processing stack v2——代码结构分析_第3张图片

你可能感兴趣的:(Unity)