Skip to main content

ssr_fade

Function ssr_fade 

Source
pub fn ssr_fade(screen_uv: Vec2, hit_dist: f32, roughness: f32) -> f32
Expand description

Compute the SSR fade factor — attenuates hits near screen edges and for high roughness.

screen_uv — screen UV of the hit point [0,1]² hit_dist — distance travelled by the SSR ray roughness — material roughness