-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Solari: Better path termination heuristic #22570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…nts WC from showing up in reflections when you're really close to something)
…proper-mirror-brdf
…proper-mirror-brdf
| let brdf = evaluate_brdf(N, wo, wi, ray_hit.material); | ||
| let cos_theta = saturate(dot(wi, N)); | ||
| throughput *= (brdf * cos_theta) / p_bounce; | ||
| throughput *= brdf / p_bounce; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a small bugfix that was missed in #22468
|
|
||
| if path_spread * path_spread > a0 * get_cell_size(ray_hit.world_position, view.world_position) { | ||
| // Path spread is wide enough, terminate path in the world cache | ||
| // Terminate path in the world cache if the ray is long enough and the path spread is large enough |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a citation or description akin to your PR description here to explain how this metric was selected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's kinda adhoc based on testing some stuff and what RTXGI was doing. There's not much basis to it really.
| fn path_spread_heuristic(ray_t: f32, roughness: f32) -> f32 { | ||
| let alpha_squared = min(roughness * roughness, 0.99); | ||
| let distance_squared = ray_t * ray_t; | ||
| return distance_squared * 0.5 * (alpha_squared / (1.0 - alpha_squared)); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Partially copied from SHaRC, but accumulated over multiple bounces instead of the single bounce I think SHaRC does. Basically it's using the roughness to compute the area of a disk a certain distance along a code.
|
I think there's still a bug when querying the world cache. cos_theta is no longer applied when sampling DI in world cache update. I think we need to apply cos_theta when querying the WC? |
I was using a path termination heuristic designed for a radiance cache, but solari uses an irradiance cache. Whoops.
This new heuristic is inspired by RTXGI, and prevents the world cache from showing up in reflections properly.
To test, move the camera close to a mirror surface.
Also contains some bugfixes for bugs introduced in #22468.