Merge branch 'blender-v4.1-release' into main
This commit is contained in:
@@ -1285,42 +1285,78 @@ void PathTrace::set_guiding_params(const GuidingParams &guiding_params, const bo
|
||||
if (guiding_params_.modified(guiding_params)) {
|
||||
guiding_params_ = guiding_params;
|
||||
|
||||
# if !(OPENPGL_VERSION_MAJOR == 0 && OPENPGL_VERSION_MINOR <= 5)
|
||||
# define OPENPGL_USE_FIELD_CONFIG
|
||||
# endif
|
||||
|
||||
if (guiding_params_.use) {
|
||||
# ifdef OPENPGL_USE_FIELD_CONFIG
|
||||
openpgl::cpp::FieldConfig field_config;
|
||||
# else
|
||||
PGLFieldArguments field_args;
|
||||
# endif
|
||||
switch (guiding_params_.type) {
|
||||
default:
|
||||
/* Parallax-aware von Mises-Fisher mixture models. */
|
||||
case GUIDING_TYPE_PARALLAX_AWARE_VMM: {
|
||||
# ifdef OPENPGL_USE_FIELD_CONFIG
|
||||
field_config.Init(
|
||||
PGL_SPATIAL_STRUCTURE_TYPE::PGL_SPATIAL_STRUCTURE_KDTREE,
|
||||
PGL_DIRECTIONAL_DISTRIBUTION_TYPE::PGL_DIRECTIONAL_DISTRIBUTION_PARALLAX_AWARE_VMM,
|
||||
guiding_params.deterministic);
|
||||
# else
|
||||
pglFieldArgumentsSetDefaults(
|
||||
field_args,
|
||||
PGL_SPATIAL_STRUCTURE_TYPE::PGL_SPATIAL_STRUCTURE_KDTREE,
|
||||
PGL_DIRECTIONAL_DISTRIBUTION_TYPE::PGL_DIRECTIONAL_DISTRIBUTION_PARALLAX_AWARE_VMM);
|
||||
# endif
|
||||
break;
|
||||
}
|
||||
/* Directional quad-trees. */
|
||||
case GUIDING_TYPE_DIRECTIONAL_QUAD_TREE: {
|
||||
# ifdef OPENPGL_USE_FIELD_CONFIG
|
||||
field_config.Init(
|
||||
PGL_SPATIAL_STRUCTURE_TYPE::PGL_SPATIAL_STRUCTURE_KDTREE,
|
||||
PGL_DIRECTIONAL_DISTRIBUTION_TYPE::PGL_DIRECTIONAL_DISTRIBUTION_QUADTREE,
|
||||
guiding_params.deterministic);
|
||||
# else
|
||||
pglFieldArgumentsSetDefaults(
|
||||
field_args,
|
||||
PGL_SPATIAL_STRUCTURE_TYPE::PGL_SPATIAL_STRUCTURE_KDTREE,
|
||||
PGL_DIRECTIONAL_DISTRIBUTION_TYPE::PGL_DIRECTIONAL_DISTRIBUTION_QUADTREE);
|
||||
# endif
|
||||
break;
|
||||
}
|
||||
/* von Mises-Fisher mixture models. */
|
||||
case GUIDING_TYPE_VMM: {
|
||||
# ifdef OPENPGL_USE_FIELD_CONFIG
|
||||
field_config.Init(PGL_SPATIAL_STRUCTURE_TYPE::PGL_SPATIAL_STRUCTURE_KDTREE,
|
||||
PGL_DIRECTIONAL_DISTRIBUTION_TYPE::PGL_DIRECTIONAL_DISTRIBUTION_VMM,
|
||||
guiding_params.deterministic);
|
||||
# else
|
||||
pglFieldArgumentsSetDefaults(
|
||||
field_args,
|
||||
PGL_SPATIAL_STRUCTURE_TYPE::PGL_SPATIAL_STRUCTURE_KDTREE,
|
||||
PGL_DIRECTIONAL_DISTRIBUTION_TYPE::PGL_DIRECTIONAL_DISTRIBUTION_VMM);
|
||||
# endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
# ifdef OPENPGL_USE_FIELD_CONFIG
|
||||
field_config.SetSpatialStructureArgMaxDepth(16);
|
||||
# else
|
||||
field_args.deterministic = guiding_params.deterministic;
|
||||
reinterpret_cast<PGLKDTreeArguments *>(field_args.spatialSturctureArguments)->maxDepth = 16;
|
||||
# endif
|
||||
openpgl::cpp::Device *guiding_device = static_cast<openpgl::cpp::Device *>(
|
||||
device_->get_guiding_device());
|
||||
if (guiding_device) {
|
||||
guiding_sample_data_storage_ = make_unique<openpgl::cpp::SampleStorage>();
|
||||
# ifdef OPENPGL_USE_FIELD_CONFIG
|
||||
guiding_field_ = make_unique<openpgl::cpp::Field>(guiding_device, field_config);
|
||||
# else
|
||||
guiding_field_ = make_unique<openpgl::cpp::Field>(guiding_device, field_args);
|
||||
# endif
|
||||
}
|
||||
else {
|
||||
guiding_sample_data_storage_ = nullptr;
|
||||
|
||||
@@ -956,6 +956,9 @@ if(WITH_GTESTS)
|
||||
endif()
|
||||
if(WITH_VULKAN_BACKEND)
|
||||
add_definitions(-DWITH_VULKAN_BACKEND)
|
||||
list(APPEND INC_SYS
|
||||
PUBLIC ${VULKAN_INCLUDE_DIRS}
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user