Loading...
Searching...
No Matches
config.h
1//
2// Copyright 2017 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_IMAGING_PLUGIN_HD_EMBREE_CONFIG_H
8#define PXR_IMAGING_PLUGIN_HD_EMBREE_CONFIG_H
9
10#include "pxr/pxr.h"
12
13PXR_NAMESPACE_OPEN_SCOPE
14
15// NOTE: types here restricted to bool/int/string, as also used for
16// TF_DEFINE_ENV_SETTING
17constexpr int HdEmbreeDefaultSamplesToConvergence = 100;
18constexpr int HdEmbreeDefaultTileSize = 8;
19constexpr int HdEmbreeDefaultAmbientOcclusionSamples = 16;
20constexpr bool HdEmbreeDefaultJitterCamera = true;
21constexpr bool HdEmbreeDefaultUseFaceColors = true;
22constexpr int HdEmbreeDefaultCameraLightIntensity = 300;
23constexpr int HdEmbreeDefaultRandomNumberSeed = -1;
24constexpr bool HdEmbreeDefaultUseLighting = false;
25
40public:
41
43 static const HdEmbreeConfig &GetInstance();
44
49 unsigned int samplesToConvergence = HdEmbreeDefaultSamplesToConvergence;
50
55 unsigned int tileSize = HdEmbreeDefaultTileSize;
56
61 unsigned int ambientOcclusionSamples = HdEmbreeDefaultAmbientOcclusionSamples;
62
68 bool jitterCamera = HdEmbreeDefaultJitterCamera;
69
76 bool useFaceColors = HdEmbreeDefaultUseFaceColors;
77
82 float cameraLightIntensity = HdEmbreeDefaultCameraLightIntensity;
83
91 int randomNumberSeed = HdEmbreeDefaultRandomNumberSeed;
92
99 bool useLighting = HdEmbreeDefaultUseLighting;
100
101private:
102 // The constructor initializes the config variables with their
103 // default or environment-provided override, and optionally prints
104 // them.
106 ~HdEmbreeConfig() = default;
107
108 HdEmbreeConfig(const HdEmbreeConfig&) = delete;
109 HdEmbreeConfig& operator=(const HdEmbreeConfig&) = delete;
110
111 friend class TfSingleton<HdEmbreeConfig>;
112};
113
114PXR_NAMESPACE_CLOSE_SCOPE
115
116#endif // PXR_IMAGING_PLUGIN_HD_EMBREE_CONFIG_H
This class is a singleton, holding configuration parameters for HdEmbree.
Definition: config.h:39
bool useFaceColors
Should the renderpass use the color primvar, or flat white colors? (Flat white shows off ambient occl...
Definition: config.h:76
bool useLighting
Should the renderpass use scene lights (in particular, UsdLux-compliant area lights)?...
Definition: config.h:99
unsigned int ambientOcclusionSamples
How many ambient occlusion rays should we generate per camera ray?
Definition: config.h:61
unsigned int tileSize
How many pixels are in an atomic unit of parallel work? A work item is a square of size [tileSize x t...
Definition: config.h:55
bool jitterCamera
Should the renderpass jitter camera rays for antialiasing?
Definition: config.h:68
unsigned int samplesToConvergence
How many samples do we need before a pixel is considered converged?
Definition: config.h:49
static const HdEmbreeConfig & GetInstance()
Return the configuration singleton.
int randomNumberSeed
Seed to give to the random number generator.
Definition: config.h:91
float cameraLightIntensity
What should the intensity of the camera light be, specified as a percent of <1, 1,...
Definition: config.h:82
Manage a single instance of an object (see.
Definition: singleton.h:105
Manage a single instance of an object.