This adds path guiding features into Cycles by integrating Intel's Open Path Guiding Library. It can be enabled in the Sampling > Path Guiding panel in the render properties. This feature helps reduce noise in scenes where finding a path to light is difficult for regular path tracing. The current implementation supports guiding directional sampling decisions on surfaces, when the material contains a least one diffuse component, and in volumes with isotropic and anisotropic Henyey-Greenstein phase functions. On surfaces, the guided sampling decision is proportional to the product of the incident radiance and the normal-oriented cosine lobe and in volumes it is proportional to the product of the incident radiance and the phase function. The incident radiance field of a scene is learned and updated during rendering after each per-frame rendering iteration/progression. At the moment, path guiding is only supported by the CPU backend. Support for GPU backends will be added in future versions of OpenPGL. Ref T92571 Differential Revision: https://developer.blender.org/D15286
42 lines
647 B
C
42 lines
647 B
C
/* SPDX-License-Identifier: Apache-2.0
|
|
* Copyright 2022 Blender Foundation */
|
|
|
|
#pragma once
|
|
|
|
#ifdef WITH_PATH_GUIDING
|
|
# include <openpgl/cpp/OpenPGL.h>
|
|
# include <openpgl/version.h>
|
|
#endif
|
|
|
|
#include "util/system.h"
|
|
|
|
CCL_NAMESPACE_BEGIN
|
|
|
|
static int guiding_device_type()
|
|
{
|
|
#ifdef WITH_PATH_GUIDING
|
|
# if defined(__ARM_NEON)
|
|
return 8;
|
|
# else
|
|
# if OPENPGL_VERSION_MINOR >= 4
|
|
if (system_cpu_support_avx2()) {
|
|
return 8;
|
|
}
|
|
# endif
|
|
if (system_cpu_support_sse41()) {
|
|
return 4;
|
|
}
|
|
return 0;
|
|
# endif
|
|
#else
|
|
return 0;
|
|
#endif
|
|
}
|
|
|
|
static inline bool guiding_supported()
|
|
{
|
|
return guiding_device_type() != 0;
|
|
}
|
|
|
|
CCL_NAMESPACE_END
|