Solari: Improve spatial sample finding#22617
Conversation
| let spatial_surface = gpixel_resolve(textureLoad(gbuffer, spatial_pixel_id, 0), spatial_depth, spatial_pixel_id, view.main_pass_viewport.zw, view.world_from_clip); | ||
| let spatial_diffuse_brdf = spatial_surface.material.base_color / PI; | ||
| if pixel_dissimilar(depth, world_position, spatial_surface.world_position, world_normal, spatial_surface.world_normal, view) { | ||
| search_radius /= 2.0; |
There was a problem hiding this comment.
What's the reasoning behind halving the search radius each iteration? Is this part of the original restir literature that we missed earlier, or is this a novel finding?
There was a problem hiding this comment.
Just a random idea I had. Seems to work well in practice.
There was a problem hiding this comment.
Could this not lead to correlations because the search radius at the end is around 2 pixels? Or does the temporal permutation hide it?
There was a problem hiding this comment.
I didn't notice issues when I was testing, but please test yourself and confirm! The archway on the left is a good candidate.
There was a problem hiding this comment.
We can also clamp to a minimum radius if needed.
There was a problem hiding this comment.
Seems to be fine in my testing too
Pink is visualizing pixels without a valid spatial sample (for ReSTIR GI).
Before:

After:
