Andyfanshen / RayTracing-with-Unity-URP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RayTracing-with-Unity-URP

Updated at 2024.4

Maintance Stopped! If you would like a more stable, robust and efficient path tracing renderer with Unity URP, and you also have the device supports hardware-raytracing (i.e. RTX series GPU cards), you may try this project: https://github.com/Andyfanshen/CustomRayTracing.

Renderer Feature

We add a path tracing pass before postprocess pass by renderer feature, that's why we can run path tracing with Unity URP renderer. To enable the raytracing feature, you should:

  • Clone the scripts to your Unity-URP project assets (It must be Unity 2022.1+)
  • Create URP Asset(with Universal Renderer) in your assets(by Create->Rendering->URP Asset)
  • Unity will create two assets: "**.asset" and "**_Renderer.asset"
  • Choose "**_Renderer.asset", click "Add Renderer Feature" button at the bottom of the Inspector panel
  • Choose "Ray Tracing Render Feature"
  • Edit->Project Settings->Quality->Render Pipeline Asset, replace the default asset with the asset created before

Now, you have enabled the raytracing feature in your pipeline asset, the following steps tell you how to run a test scene with path tracing

  • Choose your Volume(current camera under effect), add override "My Ray Tracing"
  • Disable all other effects (e.g. Tonemapping, Bloom, Vignette), some post processings may conflict with the raytracing feature.
  • Enable all items and configure them 图片

A test scene may like this: 图片 image

About


Languages

Language:C# 92.6%Language:ShaderLab 7.4%