1 #ifndef R2_BILATERAL_BLUR_H 2 #define R2_BILATERAL_BLUR_H 25 R2_bilateralBlurDepthAwareSample4f(
31 const vec4 center_val,
32 const float center_depth,
33 inout
float weight_total)
36 textureLod (t, uv, 0.0);
41 -radius * radius * blur.
falloff;
43 next_depth - center_depth;
47 float weight = exp (falloff - sharpness);
48 weight_total += weight;
50 return weight * next_val;
71 float weight_total = 0.0;
74 textureLod (t, uv, 0.0);
78 vec4 sum = vec4 (0.0);
83 sum += R2_bilateralBlurDepthAwareSample4f(
84 t, d, blur, uv_off, r, center_val, center_depth, weight_total);
87 return sum / weight_total;
108 float weight_total = 0.0;
111 textureLod (t, uv, 0.0);
115 vec4 sum = vec4 (0.0);
120 sum += R2_bilateralBlurDepthAwareSample4f(
121 t, d, blur, uv_off, r, center_val, center_depth, weight_total);
124 return sum / weight_total;
127 #endif // R2_BILATERAL_BLUR_H vec2 output_image_size_inverse
The inverse of the output image size: (1 / width, 1 / height)
float radius
The blur radius in texels (typically between 3 and 7)
vec4 R2_bilateralBlurDepthAwareHorizontal4f(const sampler2D t, const sampler2D d, const R2_bilateral_blur_depth_aware_t blur, const vec2 uv)
float depth_coefficient
The depth coefficient that was used to produce the scene's depth values.
float sharpness
The blur sharpness value (typically 16)
float falloff
The blur falloff value.
Parameters for the blur effect.
float R2_logDepthDecode(const float z, const float depth_coefficient)
vec4 R2_bilateralBlurDepthAwareVertical4f(const sampler2D t, const sampler2D d, const R2_bilateral_blur_depth_aware_t blur, const vec2 uv)
Logarithmic depth functions.