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