I thought it was unusable because of the noisiness and speed, but surprisingly found that it can be usable in some cases. (Tested on a mobile device with TAA)
I will test it further once the “Blit” mode works, and I think a box projected probe fallback will greatly improve the stability of this screen space effect.
Most of the artifacts (weird shadows) are fixed by considering back-face in ray marching. These back-faces reuse the front GBuffer to reduce performance cost.
Before:
The back-face now appears in reflection when “Accurate Thickness” (render back-face depth) is enabled. This may not be 100% correct but looks much better than before (with hole).
Hey, I’m still looking for a way that is efficient enough (less draw call & overdraw) to implement per object reflection probe fallback.
So I added refraction support to it first. To render refractions, objects need to use “Universal Render Pipeline/Screen Space Path Tracing/Refraction Lit” shader graph, which is provided by the repository, and tick “Support Refraction” in the accumulation renderer feature.
This allows calculating the actual thickness of refracting objects, and find intersections for opaque objects that are covered by them.
The “_TransparentGBuffer1” (specular.rgb occlusion.a) is used to store index of refraction (ior.r) and surface type (surfaceType.a). The “occlusion.a” for other transparent objects will be 1.0.
As this effect is based on rasterization, it doesn’t support recursive refraction, which means that other refractions cannot be seen in refractions.
For Unity lights, (shadows) transparency uses dithered transparent shadows.
Only path traced shadows (from indirect lighting, emission, …) can have things like refraction caustics.
I saw a simple but effective open source spatial denoiser on shadertoy, and it works well after porting to URP. It uses different surface data to avoid blurring the edges and colors.
Now it’s possible to use recorder to export videos without setting extremely high SPPs.
Temporal Denoise Only (TAA + Real-time Accumulation): z15pf7
Temporal Spatial Denoise: rjm3a0
TAA causes severe ghosting, maybe need to find a way to replace it.
The reflection probe atlas in Forward+ makes accessing all reflection probes in a full screen shader possible. I’ve tried it and the results were satisfying.
Forward and Deferred:
Forward+:
I haven’t pulled it to the repo yet because I think it needs more tests and I’m considering downgrading the repo’s editor version to 2022 LTS (from 2023.1b).
This repo is also the foundation of adding a good enough SSGI for URP to me. I wasn’t very satisfied with my SSR (based on an early version of this SSPT), so I decided to spend more time improving this (ex. the most important denoise) first before starting to add SSGI.
Thanks for pointing it out! Do you mean the blue gray book in the first screenshot?
I increased the total steps (low: 24 → medium: 48) to test if it’s relevant, and found that it’s because of the lack of information in screen space (being occluded).
It could be improved if there was a way to render more layers of depth, but I doubt it’s worth it in terms of performance. Another solution might be to use inline ray tracing, but obviously it’s not the time yet. (Vulkan inline ray tracing in URP)
Hey, I just updated the repo and would like to briefly introduce the changes. (with screenshots)
Added
Unified Renderer Features: Combined all renderer features (and shaders) into a single one, making the effect easier to use.
Add SSPT to URP Volume: Allows controlling SSPT settings in the scene’s URP Volume.
Render Graph Support: Added support for Render Graph. (Requires Unity 6000.0.0f1 or newer)
Ray Marching Quality: Improved the quality of ray marching by dividing ray marching steps into small, medium, and large steps. (see “PathTracingConfig.hlsl”)
Denoising Redesign: Redesigned the real-time denoising for cleaner and less ghosting results.
Refraction: Improved path tracing refraction calculations. (ex. more stable caustics from reflection probes)
Fixed
Refraction: Fixed the incorrect Color Blend options in the Transparent GBuffer Pass.
Known Issues
When the active platform in the editor is set to Android, object’s compiling shaders may output incorrect extreme color values (e.g., green) to reflection probes (for one frame) which will be spread to the entire screen by SSPT. This does not appear in build.
After SSPT automatically sets the scene’s ambient lighting to zero, it will not restore the original ambient lighting settings (Lighting Panel → Environment → Environment Lighting).
I also found that TAA is applied after this effect in Unity 6 (preview) which is much better than before.
Obviously “High” (4 rays + 64 steps) is a performance killer for most URP target devices (ex. mobiles), so I also tested “Custom” (1 ray + 32 steps + half resolution):
Hi, sorry for the late reply, do you mean the slightly bluish tint in the corners?
Thanks for pointing it out! I thought there was a bug somewhere, but later found out that it’s from the HDRI skybox. (specifically, sky background in reflection probes)
The room has an “open” ceiling to let in more sunlight. (weird design, isn’t it?)
Fully black sky, no bluish tint:
If you find anything strange, please feel free to point it out!