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