URP 包含多个注入点,允许您将渲染通道注入帧渲染循环并在不同的事件中执行它们。
注入点使自定义渲染通道能够访问 URP 缓冲区。渲染通道在每个注入点都具有对所有缓冲区的读写访问权限。
Unity 在渲染循环中提供了以下事件。您可以使用这些事件来注入自定义通道。
注入点 | 描述 |
---|---|
BeforeRendering | 在为当前摄像机一个组件,用于创建场景中特定视点的图像。输出要么绘制到屏幕上,要么作为纹理捕获。 更多信息 参见 术语表渲染任何其他通道之前,执行 ScriptableRenderPass 实例。此时尚未设置摄像机矩阵和立体渲染。您可以使用此注入点绘制到管道中稍后使用的自定义输入纹理,例如 LUT 纹理。 |
BeforeRenderingShadows | 在渲染阴影贴图(MainLightShadow、AdditionalLightsShadow 通道)之前,执行ScriptableRenderPass 实例。此时尚未设置摄像机矩阵和立体渲染。 |
AfterRenderingShadows | 在渲染阴影贴图(MainLightShadow、AdditionalLightsShadow 通道)之后,执行ScriptableRenderPass 实例。此时尚未设置摄像机矩阵和立体渲染。 |
BeforeRenderingPrePasses | 在渲染预通道(DepthPrepass、DepthNormalPrepass 通道)之前,执行ScriptableRenderPass 实例。此时已设置摄像机矩阵和立体渲染。 |
AfterRenderingPrePasses | 在渲染预通道(DepthPrepass、DepthNormalPrepass 通道)之后,执行ScriptableRenderPass 实例。此时已设置摄像机矩阵和立体渲染。 |
BeforeRenderingGbuffer | 在渲染GBuffer通道之前,执行ScriptableRenderPass 实例。 |
AfterRenderingGbuffer | 在渲染GBuffer通道之后,执行ScriptableRenderPass 实例。 |
BeforeRenderingDeferredLights | 在渲染延迟通道之前,执行ScriptableRenderPass 实例。 |
AfterRenderingDeferredLights | 在渲染延迟通道之后,执行ScriptableRenderPass 实例。 |
BeforeRenderingOpaques | 在渲染不透明物体(DrawOpaqueObjects通道)之前,执行ScriptableRenderPass 实例。 |
AfterRenderingOpaques | 在渲染不透明物体(DrawOpaqueObjects通道)之后,执行ScriptableRenderPass 实例。 |
BeforeRenderingSkybox | 在渲染天空盒一种特殊类型的材质,用于表示天空。通常为六面体。 更多信息 参见 术语表(Camera.RenderSkybox通道)之前,执行 ScriptableRenderPass 实例。 |
AfterRenderingSkybox | 在渲染天空盒(Camera.RenderSkybox通道)之后,执行ScriptableRenderPass 实例。 |
BeforeRenderingTransparents | 在渲染透明物体(DrawTransparentObjects通道)之前,执行ScriptableRenderPass 实例。 |
AfterRenderingTransparents | 在渲染透明物体(DrawTransparentObjects通道)之后,执行ScriptableRenderPass 实例。 |
BeforeRenderingPostProcessing | 在渲染后期处理在图像显示在屏幕上之前应用滤镜和效果来改善产品视觉效果的过程。您可以使用后期处理效果来模拟物理相机和胶片属性,例如 Bloom 和景深。 更多信息 后期处理,后期处理,后期处理 参见 术语表效果(Render PostProcessing Effects通道)之前,执行 ScriptableRenderPass 实例。 |
AfterRenderingPostProcessing | 在渲染后期处理效果之后但最终blit“位块传输”的简称。blit 操作是从内存中的一个位置到另一个位置传输数据块的过程。 参见 术语表、后期处理抗锯齿效果和颜色分级之前,执行 ScriptableRenderPass 实例。 |
AfterRendering | 在渲染所有其他通道之后,执行ScriptableRenderPass 实例。 |
下图显示了通道和 URP 帧中帧资源的流程
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.