27 const int filter_width = radius * 2 + 1;
33 const float gaussian_params[filter_width] = {0.0012273699895602f,
50 for (
int dx = 0; dx < filter_width; dx++) {
51 const int x = center_x + dx - radius;
60 const float weight = gaussian_params[dx] /
83 const int filter_width = radius * 2 + 1;
85 const float gaussian_params[filter_width] = {0.0012273699895602f,
98 float3 scatter_neighbors[filter_width], transmit_neighbors[filter_width];
101 for (
int i = 0; i < filter_width; i++) {
102 const int y = min_y + i;
105 scatter_neighbors[i] = transmit_neighbors[i] =
zero_float3();
113 buffer +
kernel_data.film.pass_volume_transmit_denoised);
119 for (
int y = min_y;
y < max_y;
y++) {
121 const int next_y =
y + radius;
122 if (next_y < min_y || next_y >= max_y) {
130 buffer +
kernel_data.film.pass_volume_scatter_denoised);
132 buffer +
kernel_data.film.pass_volume_transmit_denoised);
140 for (
int i = 0; i < filter_width; i++) {
141 scatter += gaussian_params[i] * scatter_neighbors[(
index + i) % filter_width];
142 transmit += gaussian_params[i] * transmit_neighbors[(
index + i) % filter_width];
#define kernel_assert(cond)
#define CCL_NAMESPACE_END
ccl_gpu_kernel_postfix ccl_global KernelWorkTile const int ccl_global float * render_buffer
void KERNEL_FUNCTION_FULL_NAME volume_guiding_filter_x(const ThreadKernelGlobalsCPU *kg, ccl_global float *render_buffer, const int y, const int center_x, const int min_x, const int max_x, const int offset, int stride)
void KERNEL_FUNCTION_FULL_NAME volume_guiding_filter_y(const ThreadKernelGlobalsCPU *kg, ccl_global float *render_buffer, const int x, const int center_y, const int height, const int offset, int stride)
ccl_device_inline dual3 fabs(const ccl_private dual3 &a)
CCL_NAMESPACE_BEGIN ccl_device_inline float3 zero_float3()
closure color scatter(string phase, float Anisotropy, float IOR, float Backscatter, float Alpha, float Diameter)
ccl_device_inline float3 kernel_read_pass_float3(const ccl_global float *ccl_restrict buffer)
ccl_device_inline void film_overwrite_pass_rgbe(ccl_global float *ccl_restrict buffer, const float3 value)
CCL_NAMESPACE_BEGIN ccl_device_forceinline ccl_global float * film_pass_pixel_render_buffer(KernelGlobals kg, ConstIntegratorState state, ccl_global float *ccl_restrict render_buffer)
ccl_device_inline float3 kernel_read_pass_rgbe(const ccl_global float *ccl_restrict buffer)