HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
spec.h
Go to the documentation of this file.
1 //
2 // Copyright 2016 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_USD_USD_RENDER_SPEC_H
8 #define PXR_USD_USD_RENDER_SPEC_H
9 
10 /// \file usdRender/spec.h
11 
12 #include "pxr/pxr.h"
13 #include "pxr/usd/usdRender/api.h"
15 #include "pxr/usd/usd/prim.h"
16 #include "pxr/usd/usd/stage.h"
18 
19 #include "pxr/base/gf/frustum.h"
20 
21 #include "pxr/base/vt/dictionary.h"
22 #include "pxr/base/vt/value.h"
23 
24 #include "pxr/base/gf/vec3d.h"
25 #include "pxr/base/gf/vec3f.h"
26 #include "pxr/base/gf/matrix4d.h"
27 
28 #include "pxr/base/tf/token.h"
29 #include "pxr/base/tf/type.h"
30 
32 
33 class UsdRenderSettings;
34 
35 /// A self-contained specification of render settings.
36 /// \note This is preliminary API and is likely to change.
37 struct UsdRenderSpec {
38  /// Specification of a product. See UsdRenderProduct.
39  struct Product {
40  /// The path of this product, which uniquely identifies it.
42  /// The type of product, ex: "raster".
44  /// The name of the product, which uniquely identifies it.
46  /// Path to the primary UsdGeomCamera camera to use for this product.
48  /// If set to true, disables motion blur.
50  /// If set to true, disables depth of field.
52  /// The pixel resolution of the product.
54  /// The pixel aspect ratio as adjusted by aspectRatioConformPolicy.
56  /// The policy that was applied to conform aspect ratio
57  /// mismatches between the aperture and image.
59  /// The camera aperture size as adjusted by aspectRatioConformPolicy.
61  /// The data window, in NDC terms relative to the aperture.
62  /// (0,0) corresponds to bottom-left and (1,1) corresponds to
63  /// top-right. Note that the data window can partially cover
64  /// or extend beyond the unit range, for representing overscan
65  /// or cropped renders.
67  /// The render vars used by this product, as indices into the
68  /// top-level renderVars array.
69  std::vector<size_t> renderVarIndices;
70  /// Any extra settings values discovered in requested namespaces.
72  };
73  /// Specification of a render variable (aka AOV). See UsdRenderVar.
74  struct RenderVar {
75  /// The path of this render var, which uniquely identifies it.
77  /// The value data type of the variable, as a USD type name.
79  std::string sourceName;
81  /// Any extra settings values discovered in requested namespaces.
83  };
84  /// The full list of products requested by this render.
85  std::vector<Product> products;
86  /// The full list of render vars requested by products in this render.
87  std::vector<RenderVar> renderVars;
88  /// List of purposes to use to filter scene contents.
90  /// List of material binding purposes.
92  /// Any extra settings values discovered in requested namespaces.
94 };
95 
96 /// Computes the specification of the render settings.
97 /// For each product, applies the aspectRatioConformPolicy
98 /// and computes a final screenWindow and pixelAspectRatio.
99 ///
100 /// Any other attributes encountered are returned in namespacedSettings.
101 /// If a non-empty list of namespaces is provided, only attributes
102 /// within those namespaces are returned.
103 /// If an empty list of namespaces is provided, all custom
104 /// (non-schema) attributes are returned.
105 /// The same list of namespaces is used for finding namespacedSettings
106 /// in all UsdRender prim types.
110  TfTokenVector const& namespaces);
111 
112 /// Returns a dictionary populated with attributes filtered by the namespaces.
113 /// If a non-empty list of namespaces is provided, only authored attributes
114 /// within those namespaces are returned.
115 /// If an empty list of namespaces is provided, all custom (non-schema)
116 /// attributes are returned.
117 /// \note Special handling is provided for connectable attributes that are used
118 /// to represent node graph outputs.
122  TfTokenVector const& namespaces);
123 
125 
126 #endif
SdfPath renderVarPath
The path of this render var, which uniquely identifies it.
Definition: spec.h:76
GfRange2f dataWindowNDC
Definition: spec.h:66
USDRENDER_API VtDictionary UsdRenderComputeNamespacedSettings(UsdPrim const &prim, TfTokenVector const &namespaces)
TfToken dataType
The value data type of the variable, as a USD type name.
Definition: spec.h:78
TfToken name
The name of the product, which uniquely identifies it.
Definition: spec.h:45
GfVec2i resolution
The pixel resolution of the product.
Definition: spec.h:53
VtDictionary namespacedSettings
Any extra settings values discovered in requested namespaces.
Definition: spec.h:93
Definition: vec2i.h:43
#define USDRENDER_API
Definition: api.h:23
TfToken sourceType
Definition: spec.h:80
VtArray< TfToken > materialBindingPurposes
List of material binding purposes.
Definition: spec.h:91
std::vector< size_t > renderVarIndices
Definition: spec.h:69
TfToken type
The type of product, ex: "raster".
Definition: spec.h:43
bool disableDepthOfField
If set to true, disables depth of field.
Definition: spec.h:51
SdfPath cameraPath
Path to the primary UsdGeomCamera camera to use for this product.
Definition: spec.h:47
VtArray< TfToken > includedPurposes
List of purposes to use to filter scene contents.
Definition: spec.h:89
Specification of a render variable (aka AOV). See UsdRenderVar.
Definition: spec.h:74
Definition: token.h:70
USDRENDER_API UsdRenderSpec UsdRenderComputeSpec(UsdRenderSettings const &settings, TfTokenVector const &namespaces)
bool disableMotionBlur
If set to true, disables motion blur.
Definition: spec.h:49
VtDictionary namespacedSettings
Any extra settings values discovered in requested namespaces.
Definition: spec.h:82
std::vector< RenderVar > renderVars
The full list of render vars requested by products in this render.
Definition: spec.h:87
SdfPath renderProductPath
The path of this product, which uniquely identifies it.
Definition: spec.h:41
std::string sourceName
Definition: spec.h:79
Definition: prim.h:116
GfVec2f apertureSize
The camera aperture size as adjusted by aspectRatioConformPolicy.
Definition: spec.h:60
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
Definition: path.h:273
std::vector< Product > products
The full list of products requested by this render.
Definition: spec.h:85
Specification of a product. See UsdRenderProduct.
Definition: spec.h:39
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
Definition: vec2f.h:45
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
TfToken aspectRatioConformPolicy
Definition: spec.h:58
VtDictionary namespacedSettings
Any extra settings values discovered in requested namespaces.
Definition: spec.h:71
float pixelAspectRatio
The pixel aspect ratio as adjusted by aspectRatioConformPolicy.
Definition: spec.h:55