HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
lightSettingsAPI.h
Go to the documentation of this file.
1 //
2 // Copyright 2016 Pixar
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 #ifndef USDKARMA_GENERATED_LIGHTSETTINGSAPI_H
25 #define USDKARMA_GENERATED_LIGHTSETTINGSAPI_H
26 
27 /// \file usdKarma/lightSettingsAPI.h
28 
29 #include "pxr/pxr.h"
30 #include ".//api.h"
32 #include "pxr/usd/usd/prim.h"
33 #include "pxr/usd/usd/stage.h"
34 #include ".//tokens.h"
35 
36 #include "pxr/base/vt/value.h"
37 
38 #include "pxr/base/gf/vec3d.h"
39 #include "pxr/base/gf/vec3f.h"
40 #include "pxr/base/gf/matrix4d.h"
41 
42 #include "pxr/base/tf/token.h"
43 #include "pxr/base/tf/type.h"
44 
46 
47 class SdfAssetPath;
48 
49 // -------------------------------------------------------------------------- //
50 // KARMALIGHTSETTINGSAPI //
51 // -------------------------------------------------------------------------- //
52 
53 /// \class usdKarmaLightSettingsAPI
54 ///
55 ///
56 class
59 {
60 public:
61  /// Compile time constant representing what kind of schema this class is.
62  ///
63  /// \sa UsdSchemaType
64  static const UsdSchemaType schemaType = UsdSchemaType::SingleApplyAPI;
65 
66  /// Construct a usdKarmaLightSettingsAPI on UsdPrim \p prim .
67  /// Equivalent to usdKarmaLightSettingsAPI::Get(prim.GetStage(), prim.GetPath())
68  /// for a \em valid \p prim, but will not immediately throw an error for
69  /// an invalid \p prim
70  explicit usdKarmaLightSettingsAPI(const UsdPrim& prim=UsdPrim())
71  : UsdAPISchemaBase(prim)
72  {
73  }
74 
75  /// Construct a usdKarmaLightSettingsAPI on the prim held by \p schemaObj .
76  /// Should be preferred over usdKarmaLightSettingsAPI(schemaObj.GetPrim()),
77  /// as it preserves SchemaBase state.
78  explicit usdKarmaLightSettingsAPI(const UsdSchemaBase& schemaObj)
79  : UsdAPISchemaBase(schemaObj)
80  {
81  }
82 
83  /// Destructor.
84  virtual ~usdKarmaLightSettingsAPI();
85 
86  /// Return a vector of names of all pre-declared attributes for this schema
87  /// class and all its ancestor classes. Does not include attributes that
88  /// may be authored by custom/extended methods of the schemas involved.
89  static const TfTokenVector &
90  GetSchemaAttributeNames(bool includeInherited=true);
91 
92  /// Return a usdKarmaLightSettingsAPI holding the prim adhering to this
93  /// schema at \p path on \p stage. If no prim exists at \p path on
94  /// \p stage, or if the prim at that path does not adhere to this schema,
95  /// return an invalid schema object. This is shorthand for the following:
96  ///
97  /// \code
98  /// usdKarmaLightSettingsAPI(stage->GetPrimAtPath(path));
99  /// \endcode
100  ///
102  Get(const UsdStagePtr &stage, const SdfPath &path);
103 
104 
105  /// Applies this <b>single-apply</b> API schema to the given \p prim.
106  /// This information is stored by adding "KarmaLightSettingsAPI" to the
107  /// token-valued, listOp metadata \em apiSchemas on the prim.
108  ///
109  /// \return A valid usdKarmaLightSettingsAPI object is returned upon success.
110  /// An invalid (or empty) usdKarmaLightSettingsAPI object is returned upon
111  /// failure. See \ref UsdAPISchemaBase::_ApplyAPISchema() for conditions
112  /// resulting in failure.
113  ///
114  /// \sa UsdPrim::GetAppliedSchemas()
115  /// \sa UsdPrim::HasAPI()
116  ///
118  Apply(const UsdPrim &prim);
119 
120 protected:
121  /// Returns the type of schema this class belongs to.
122  ///
123  /// \sa UsdSchemaType
124  virtual UsdSchemaType _GetSchemaType() const;
125 
126 private:
127  // needs to invoke _GetStaticTfType.
128  friend class UsdSchemaRegistry;
129  static const TfType &_GetStaticTfType();
130 
131  static bool _IsTypedSchema();
132 
133  // override SchemaBase virtuals.
134  virtual const TfType &_GetTfType() const;
135 
136 public:
137  // --------------------------------------------------------------------- //
138  // KARMALIGHTACTIVERADIUS
139  // --------------------------------------------------------------------- //
140  /// Outside this radius, the light will have no effect.
141  ///
142  /// \n C++ Type: float
143  /// \n Usd Type: SdfValueTypeNames->Float
144  /// \n Variability: SdfVariabilityVarying
145  /// \n Fallback Value: -1.0
146  UsdAttribute GetKarmaLightActiveradiusAttr() const;
147 
148  /// See GetKarmaLightActiveradiusAttr(), and also
149  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
150  /// If specified, author \p defaultValue as the attribute's default,
151  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
152  /// the default for \p writeSparsely is \c false.
153  UsdAttribute CreateKarmaLightActiveradiusAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
154 
155 public:
156  // --------------------------------------------------------------------- //
157  // KARMALIGHTCATEGORY
158  // --------------------------------------------------------------------- //
159  /// The category identifier used to select this light source for illumination.
160  ///
161  /// \n C++ Type: std::string
162  /// \n Usd Type: SdfValueTypeNames->String
163  /// \n Variability: SdfVariabilityVarying
164  /// \n Fallback Value:
165  UsdAttribute GetKarmaLightCategoryAttr() const;
166 
167  /// See GetKarmaLightCategoryAttr(), and also
168  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
169  /// If specified, author \p defaultValue as the attribute's default,
170  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
171  /// the default for \p writeSparsely is \c false.
172  UsdAttribute CreateKarmaLightCategoryAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
173 
174 public:
175  // --------------------------------------------------------------------- //
176  // KARMALIGHTDISTANT_BLUR
177  // --------------------------------------------------------------------- //
178  /// For inifinite lights, this setting specifies the softness of shadows.
179  /// Normally for infinite light sources, shadows are perfectly sharp.
180  ///
181  /// \n C++ Type: float
182  /// \n Usd Type: SdfValueTypeNames->Float
183  /// \n Variability: SdfVariabilityVarying
184  /// \n Fallback Value: 0.0
185  UsdAttribute GetKarmaLightDistant_blurAttr() const;
186 
187  /// See GetKarmaLightDistant_blurAttr(), and also
188  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
189  /// If specified, author \p defaultValue as the attribute's default,
190  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
191  /// the default for \p writeSparsely is \c false.
192  UsdAttribute CreateKarmaLightDistant_blurAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
193 
194 public:
195  // --------------------------------------------------------------------- //
196  // KARMALIGHTFORCE_UNIFORM_SAMPLING
197  // --------------------------------------------------------------------- //
198  /// When using the light tree for rendering, Karma will try to put any light
199  /// source that's compatible into the tree. This option can force a light to
200  /// be excluded from the tree and subject to uniform sampling, which can
201  /// sometimes yield an improved sampling quality the light at the expense
202  /// of speed.
203  ///
204  /// \n C++ Type: bool
205  /// \n Usd Type: SdfValueTypeNames->Bool
206  /// \n Variability: SdfVariabilityVarying
207  /// \n Fallback Value: False
208  UsdAttribute GetKarmaLightForce_uniform_samplingAttr() const;
209 
210  /// See GetKarmaLightForce_uniform_samplingAttr(), and also
211  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
212  /// If specified, author \p defaultValue as the attribute's default,
213  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
214  /// the default for \p writeSparsely is \c false.
215  UsdAttribute CreateKarmaLightForce_uniform_samplingAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
216 
217 public:
218  // --------------------------------------------------------------------- //
219  // KARMALIGHTHDRI_MAX_ISIZE
220  // --------------------------------------------------------------------- //
221  /// If an environment map is larger than this resolution, it will be scaled
222  /// down when performing texture analysis. If the map has some very small,
223  /// very bright values, this filtering may affect how sampling of the
224  /// environment map is performed.
225  ///
226  /// \n C++ Type: int
227  /// \n Usd Type: SdfValueTypeNames->Int
228  /// \n Variability: SdfVariabilityVarying
229  /// \n Fallback Value: 2048
230  UsdAttribute GetKarmaLightHdri_max_isizeAttr() const;
231 
232  /// See GetKarmaLightHdri_max_isizeAttr(), and also
233  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
234  /// If specified, author \p defaultValue as the attribute's default,
235  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
236  /// the default for \p writeSparsely is \c false.
237  UsdAttribute CreateKarmaLightHdri_max_isizeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
238 
239 public:
240  // --------------------------------------------------------------------- //
241  // KARMALIGHTMISBIAS
242  // --------------------------------------------------------------------- //
243  /// Controls whether multiple importance sampling will sample from the BSDF,
244  /// the light, or both the BSDF and light.
245  ///
246  /// \n C++ Type: float
247  /// \n Usd Type: SdfValueTypeNames->Float
248  /// \n Variability: SdfVariabilityVarying
249  /// \n Fallback Value: 0.0
250  UsdAttribute GetKarmaLightMisbiasAttr() const;
251 
252  /// See GetKarmaLightMisbiasAttr(), and also
253  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
254  /// If specified, author \p defaultValue as the attribute's default,
255  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
256  /// the default for \p writeSparsely is \c false.
257  UsdAttribute CreateKarmaLightMisbiasAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
258 
259 public:
260  // --------------------------------------------------------------------- //
261  // KARMALIGHTSAMPLINGQUALITY
262  // --------------------------------------------------------------------- //
263  /// This is the per-light sampling quality. Increasing the quality will add
264  /// additional samples for this light source, improving the sampling quality
265  /// of this light relative to other light sources.
266  ///
267  /// \n C++ Type: float
268  /// \n Usd Type: SdfValueTypeNames->Float
269  /// \n Variability: SdfVariabilityVarying
270  /// \n Fallback Value: 1.0
271  UsdAttribute GetKarmaLightSamplingqualityAttr() const;
272 
273  /// See GetKarmaLightSamplingqualityAttr(), and also
274  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
275  /// If specified, author \p defaultValue as the attribute's default,
276  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
277  /// the default for \p writeSparsely is \c false.
278  UsdAttribute CreateKarmaLightSamplingqualityAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
279 
280 public:
281  // --------------------------------------------------------------------- //
282  // KARMALIGHTSHADOWTRACESET
283  // --------------------------------------------------------------------- //
284  /// The trace-set of geometry which act as occluders for this light source.
285  ///
286  /// \n C++ Type: std::string
287  /// \n Usd Type: SdfValueTypeNames->String
288  /// \n Variability: SdfVariabilityVarying
289  /// \n Fallback Value:
290  UsdAttribute GetKarmaLightShadowtracesetAttr() const;
291 
292  /// See GetKarmaLightShadowtracesetAttr(), and also
293  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
294  /// If specified, author \p defaultValue as the attribute's default,
295  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
296  /// the default for \p writeSparsely is \c false.
297  UsdAttribute CreateKarmaLightShadowtracesetAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
298 
299 public:
300  // --------------------------------------------------------------------- //
301  // KARMALIGHTSINGLESIDED
302  // --------------------------------------------------------------------- //
303  /// Does the light emit light from a single side (ie along the normal) or from both sides? This only has effect on planar area light types.
304  ///
305  /// \n C++ Type: bool
306  /// \n Usd Type: SdfValueTypeNames->Bool
307  /// \n Variability: SdfVariabilityVarying
308  /// \n Fallback Value: True
309  UsdAttribute GetKarmaLightSinglesidedAttr() const;
310 
311  /// See GetKarmaLightSinglesidedAttr(), and also
312  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
313  /// If specified, author \p defaultValue as the attribute's default,
314  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
315  /// the default for \p writeSparsely is \c false.
316  UsdAttribute CreateKarmaLightSinglesidedAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
317 
318 public:
319  // ===================================================================== //
320  // Feel free to add custom code below this line, it will be preserved by
321  // the code generator.
322  //
323  // Just remember to:
324  // - Close the class declaration with };
325  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
326  // - Close the include guard with #endif
327  // ===================================================================== //
328  // --(BEGIN CUSTOM CODE)--
329 };
330 
332 
333 #endif
#define USDKARMA_API
Definition: api.h:45
usdKarmaLightSettingsAPI(const UsdPrim &prim=UsdPrim())
usdKarmaLightSettingsAPI(const UsdSchemaBase &schemaObj)
UsdSchemaType
Definition: common.h:149
Definition: prim.h:131
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:438
Single Apply API schema.
Definition: path.h:287
GLsizei const GLchar *const * path
Definition: glew.h:6461
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1245
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:83
Definition: type.h:70
Definition: value.h:182