Skip to content

Latest commit

 

History

History
42 lines (23 loc) · 2.14 KB

ForwardPathSupport.md

File metadata and controls

42 lines (23 loc) · 2.14 KB

Screen Space Path Tracing in Forward path

Screen Space Path Tracing requires surface data (stored in Deferred GBuffer) to calculate lighting. It's suggested to use Deferred rendering path for better performance.

To render GBuffer in Forward path, please follow the instructions below.

UseForwardPath

Global Setup

  • Add "Screen Space Path Tracing Forward GBuffer" renderer feature to your URP project.

AddForwardGBufferFeature

  • Make sure there is a URP renderer that uses Deferred path. This tells Unity to compile shader variants for GBuffer rendering.

AddDeferredURPRenderer

OpenGL Platforms Extra Setup

By default, the GBuffer pass of URP shader ignores all OpenGL platforms. The modified copy of URP shader is (URP) version related, which means it cannot be included in this repository.

  • Right-click URP's "Lit.shader" in the package folder and open the path in File Explorer.

CustomLitShaderForGL_01

  • Copy the shader to your project's Asset folder so that it's editable.

CustomLitShaderForGL_02

  • Open the copied shader and change the name to make it easier to recognize in the inspector.

CustomLitShaderForGL_03

  • Delete all lines with "#pragma target 4.5" or "#pragma exclude_renderers gles gles3 glcore".

CustomLitShaderForGL_04

  • Change the materials' shader to the modified shader.