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  /// The pixel resolution of the product.
69  /// The pixel aspect ratio as adjusted by aspectRatioConformPolicy.
71  /// The policy that was applied to conform aspect ratio
72  /// mismatches between the aperture and image.
74  /// The camera aperture size as adjusted by aspectRatioConformPolicy.
76  /// The data window, in NDC terms relative to the aperture.
77  /// (0,0) corresponds to bottom-left and (1,1) corresponds to
78  /// top-right. Note that the data window can partially cover
79  /// or extend beyond the unit range, for representing overscan
80  /// or cropped renders.
82  /// The render vars used by this product, as indices into the
83  /// top-level renderVars array.
84  std::vector<size_t> renderVarIndices;
85  /// Any extra settings values discovered in requested namespaces.
87  };
88  /// Specification of a render variable (aka AOV). See UsdRenderVar.
89  struct RenderVar {
90  /// The path of this render var, which uniquely identifies it.
92  /// The value data type of the variable, as a USD type name.
96  /// Any extra settings values discovered in requested namespaces.
98  };
99  /// The full list of products requested by this render.
100  std::vector<Product> products;
101  /// The full list of render vars requested by products in this render.
102  std::vector<RenderVar> renderVars;
103  /// List of purposes to use to filter scene contents.
105  /// List of material binding purposes.
107  /// Any extra settings values discovered in requested namespaces.
109 };
110 
111 /// Computes the specification of the render settings.
112 /// For each product, applies the aspectRatioConformPolicy
113 /// and computes a final screenWindow and pixelAspectRatio.
114 ///
115 /// Any other attributes encountered are returned in namespacedSettings.
116 /// If a non-empty list of namespaces is provided, only attributes
117 /// within those namespaces are returned.
118 /// If an empty list of namespaces is provided, all custom
119 /// (non-schema) attributes are returned.
120 /// The same list of namespaces is used for finding namespacedSettings
121 /// in all UsdRender prim types.
125  TfTokenVector const& namespaces);
126 
127 /// Returns a dictionary populated with attributes filtered by the namespaces.
128 /// If a non-empty list of namespaces is provided, only authored attributes
129 /// within those namespaces are returned.
130 /// If an empty list of namespaces is provided, all custom (non-schema)
131 /// attributes are returned.
132 /// \note Special handling is provided for connectable attributes that are used
133 /// to represent node graph outputs.
137  TfTokenVector const& namespaces);
138 
140 
141 #endif
SdfPath renderVarPath
The path of this render var, which uniquely identifies it.
Definition: spec.h:91
GfRange2f dataWindowNDC
Definition: spec.h:81
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:93
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:68
VtDictionary namespacedSettings
Any extra settings values discovered in requested namespaces.
Definition: spec.h:108
Definition: vec2i.h:60
#define USDRENDER_API
Definition: api.h:40
TfToken sourceType
Definition: spec.h:95
GLsizei const GLchar *const * string
Definition: glcorearb.h:814
VtArray< TfToken > materialBindingPurposes
List of material binding purposes.
Definition: spec.h:106
std::vector< size_t > renderVarIndices
Definition: spec.h:84
TfToken type
The type of product, ex: "raster".
Definition: spec.h:60
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:104
Specification of a render variable (aka AOV). See UsdRenderVar.
Definition: spec.h:89
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:97
std::vector< RenderVar > renderVars
The full list of render vars requested by products in this render.
Definition: spec.h:102
SdfPath renderProductPath
The path of this product, which uniquely identifies it.
Definition: spec.h:58
std::string sourceName
Definition: spec.h:94
Definition: prim.h:135
GfVec2f apertureSize
The camera aperture size as adjusted by aspectRatioConformPolicy.
Definition: spec.h:75
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:442
Definition: path.h:291
std::vector< Product > products
The full list of products requested by this render.
Definition: spec.h:100
Specification of a product. See UsdRenderProduct.
Definition: spec.h:56
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1441
Definition: vec2f.h:62
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
TfToken aspectRatioConformPolicy
Definition: spec.h:73
VtDictionary namespacedSettings
Any extra settings values discovered in requested namespaces.
Definition: spec.h:86
float pixelAspectRatio
The pixel aspect ratio as adjusted by aspectRatioConformPolicy.
Definition: spec.h:70