Blender  V3.3
integrator/adaptive_sampling.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: Apache-2.0
2  * Copyright 2011-2022 Blender Foundation */
3 
4 #pragma once
5 
7 
9  public:
11 
12  /* Align number of samples so that they align with the adaptive filtering.
13  *
14  * Returns the new value for the `num_samples` so that after rendering so many samples on top
15  * of `start_sample` filtering is required.
16  *
17  * The alignment happens in a way that allows to render as many samples as possible without
18  * missing any filtering point. This means that the result is "clamped" by the nearest sample
19  * at which filtering is needed. This is part of mechanism which ensures that all devices will
20  * perform same exact filtering and adaptive sampling, regardless of their performance.
21  *
22  * `start_sample` is the 0-based index of sample.
23  *
24  * NOTE: The start sample is included into the number of samples to render. This means that
25  * if the number of samples is 1, then the path tracer will render samples [align_samples],
26  * if the number of samples is 2, then the path tracer will render samples [align_samples,
27  * align_samples + 1] and so on. */
28  int align_samples(int start_sample, int num_samples) const;
29 
30  /* Check whether adaptive sampling filter should happen at this sample.
31  * Returns false if the adaptive sampling is not use.
32  *
33  * `sample` is the 0-based index of sample. */
34  bool need_filter(int sample) const;
35 
36  bool use = false;
37  int adaptive_step = 0;
38  int min_samples = 0;
39  float threshold = 0.0f;
40 };
41 
bool need_filter(int sample) const
int align_samples(int start_sample, int num_samples) const
#define CCL_NAMESPACE_END
Definition: cuda/compat.h:9
ccl_gpu_kernel_postfix ccl_global float int int int int ccl_global const float int int int int int int int int int int int int num_samples