29 const std::string PARAM_MEMORY_MODE =
"memory-mode";
30 const std::string PARAM_DEFAULT_BVH_FLAG =
"default-bvh-flag";
31 const std::string PARAM_GEOMETRY_QUALITY =
"geometry-quality";
32 const std::string PARAM_DEFAULT_SDF_EPSILON =
"sdf-epsilon";
33 const std::string PARAM_DEFAULT_SDF_NB_MARCH_ITERATIONS =
"sdf-nb-march-iterations";
34 const std::string PARAM_DEFAULT_SDF_BLEND_FACTOR =
"sdf-blend-factor";
35 const std::string PARAM_DEFAULT_SDF_BLEND_LERP_FACTOR =
"sdf-blend-lerp-factor";
36 const std::string PARAM_DEFAULT_SDF_OMEGA =
"sdf-omega";
37 const std::string PARAM_DEFAULT_SDF_DISTANCE =
"sdf-distance";
39 const std::string GEOMETRY_QUALITIES[3] = {
"low",
"medium",
"high"};
40 const std::string GEOMETRY_MEMORY_MODES[2] = {
"shared",
"replicated"};
53 (PARAM_DEFAULT_SDF_EPSILON.c_str(), po::value<float>(),
"Signed distance fields geometry epsilon [float]")
55 (PARAM_DEFAULT_SDF_NB_MARCH_ITERATIONS.c_str(), po::value<uint64_t>(),
56 "Signed distance fields geometry number of ray-marching iterations [int]")
58 (PARAM_DEFAULT_SDF_BLEND_FACTOR.c_str(), po::value<float>(),
59 "Signed distance fields geometry blending factor [float]")
61 (PARAM_DEFAULT_SDF_BLEND_LERP_FACTOR.c_str(), po::value<float>(),
62 "Signed distance fields geometry lerp blending factor [float]")
64 (PARAM_DEFAULT_SDF_OMEGA.c_str(), po::value<float>(),
65 "Signed distance fields geometry ray-marching omega [float]")
67 (PARAM_DEFAULT_SDF_DISTANCE.c_str(), po::value<float>(),
68 "Distance until which Signed distance fields geometries are processed (blending and displacement) [float]")
70 (PARAM_GEOMETRY_QUALITY.c_str(), po::value<std::string>(),
"Geometry rendering quality [low|medium|high]")
72 (PARAM_MEMORY_MODE.c_str(), po::value<std::string>(),
73 "Defines what memory mode should be used between Core and "
74 "the underlying renderer [shared|replicated]")
76 (PARAM_DEFAULT_BVH_FLAG.c_str(), po::value<std::vector<std::string>>()->multitoken(),
77 "Set a default flag to apply to BVH creation, one of "
78 "[dynamic|compact|robust], may appear multiple times.");
83 if (vm.count(PARAM_GEOMETRY_QUALITY))
86 const auto& geometryQuality = vm[PARAM_GEOMETRY_QUALITY].as<std::string>();
87 for (
size_t i = 0; i <
sizeof(GEOMETRY_QUALITIES) /
sizeof(GEOMETRY_QUALITIES[0]); ++i)
88 if (geometryQuality == GEOMETRY_QUALITIES[i])
91 if (vm.count(PARAM_DEFAULT_SDF_EPSILON))
92 _sdfEpsilon = vm[PARAM_DEFAULT_SDF_EPSILON].as<float>();
93 if (vm.count(PARAM_DEFAULT_SDF_BLEND_FACTOR))
95 if (vm.count(PARAM_DEFAULT_SDF_BLEND_LERP_FACTOR))
97 if (vm.count(PARAM_DEFAULT_SDF_OMEGA))
98 _sdfOmega = vm[PARAM_DEFAULT_SDF_OMEGA].as<float>();
99 if (vm.count(PARAM_DEFAULT_SDF_DISTANCE))
100 _sdfDistance = vm[PARAM_DEFAULT_SDF_DISTANCE].as<float>();
101 if (vm.count(PARAM_MEMORY_MODE))
103 const auto& memoryMode = vm[PARAM_MEMORY_MODE].as<std::string>();
104 for (
size_t i = 0; i <
sizeof(GEOMETRY_MEMORY_MODES) /
sizeof(GEOMETRY_MEMORY_MODES[0]); ++i)
105 if (memoryMode == GEOMETRY_MEMORY_MODES[i])
108 if (vm.count(PARAM_DEFAULT_BVH_FLAG))
110 const auto& bvhs = vm[PARAM_DEFAULT_BVH_FLAG].as<std::vector<std::string>>();
111 for (
const auto& bvh : bvhs)
113 const auto kv = BVH_TYPES.find(bvh);
114 if (kv != BVH_TYPES.end())
117 throw std::runtime_error(
"Invalid bvh flag '" + bvh +
"'.");
po::options_description _parameters
void markModified(const bool triggerCallback=true)
std::set< BVHFlag > _defaultBVHFlags
void parse(const po::variables_map &vm) final
GeometryQuality _geometryQuality
float _sdfBlendLerpFactor
uint64_t _sdfNbMarchIterations