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 
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 type of product, ex: "raster".
59  /// The name of the product, which uniquely identifies it.
61  /// Path to the primary UsdGeomCamera camera to use for this product.
63  /// If set to true, disables motion blur.
65  /// The pixel resolution of the product.
67  /// The pixel aspect ratio as adjusted by aspectRatioConformPolicy.
69  /// The policy that was applied to conform aspect ratio
70  /// mismatches between the aperture and image.
72  /// The camera aperture size as adjusted by aspectRatioConformPolicy.
74  /// The data window, in NDC terms relative to the aperture.
75  /// (0,0) corresponds to bottom-left and (1,1) corresponds to
76  /// top-right. Note that the data window can partially cover
77  /// or extend beyond the unit range, for representing overscan
78  /// or cropped renders.
80  /// The render vars used by this product, as indices into the
81  /// top-level renderVars array.
82  std::vector<size_t> renderVarIndices;
83  /// Any extra settings values discovered in requested namespaces.
85  };
86  /// Specification of a render variable (aka AOV). See UsdRenderVar.
87  struct RenderVar {
88  /// The path of this render var, which uniquely identifies it.
90  /// The value data type of the variable, as a USD type name.
94  /// Any extra settings values discovered in requested namespaces.
96  };
97  /// The full list of products requested by this render.
98  std::vector<Product> products;
99  /// The full list of render vars requested by products in this render.
100  std::vector<RenderVar> renderVars;
101  /// List of purposes to use to filter scene contents.
103  /// List of material binding purposes.
105  /// Any extra settings values discovered in requested namespaces.
107 };
108 
109 /// Computes the specification of the render settings.
110 /// For each product, applies the aspectRatioConformPolicy
111 /// and computes a final screenWindow and pixelAspectRatio.
112 ///
113 /// Any other attributes encountered are returned in extraSettings.
114 /// If a non-empty list of namespaces is provided, only attributes
115 /// within those namespaces are returned.
116 /// If an empty list of namespaces is provided, all custom
117 /// (non-schema) attributes are returned.
118 /// The same list of namespaces is used for finding extraSettings
119 /// in all UsdRender prim types.
124  std::vector<std::string> const& namespaces);
125 
127 
128 #endif
SdfPath renderVarPath
The path of this render var, which uniquely identifies it.
Definition: spec.h:89
GfRange2f dataWindowNDC
Definition: spec.h:79
TfToken dataType
The value data type of the variable, as a USD type name.
Definition: spec.h:91
TfToken name
The name of the product, which uniquely identifies it.
Definition: spec.h:60
GfVec2i resolution
The pixel resolution of the product.
Definition: spec.h:66
Definition: vec2i.h:61
#define USDRENDER_API
Definition: api.h:40
GT_API const UT_StringHolder time
TfToken sourceType
Definition: spec.h:93
VtArray< TfToken > materialBindingPurposes
List of material binding purposes.
Definition: spec.h:104
USDRENDER_API UsdRenderSpec UsdRenderComputeSpec(UsdRenderSettings const &settings, UsdTimeCode time, std::vector< std::string > const &namespaces)
std::vector< size_t > renderVarIndices
Definition: spec.h:82
TfToken type
The type of product, ex: "raster".
Definition: spec.h:58
SdfPath cameraPath
Path to the primary UsdGeomCamera camera to use for this product.
Definition: spec.h:62
VtArray< TfToken > includedPurposes
List of purposes to use to filter scene contents.
Definition: spec.h:102
Specification of a render variable (aka AOV). See UsdRenderVar.
Definition: spec.h:87
Definition: token.h:87
VtDictionary extraSettings
Any extra settings values discovered in requested namespaces.
Definition: spec.h:95
bool disableMotionBlur
If set to true, disables motion blur.
Definition: spec.h:64
std::vector< RenderVar > renderVars
The full list of render vars requested by products in this render.
Definition: spec.h:100
GLsizei const GLchar *const * string
Definition: glcorearb.h:814
std::string sourceName
Definition: spec.h:92
GfVec2f apertureSize
The camera aperture size as adjusted by aspectRatioConformPolicy.
Definition: spec.h:73
Definition: path.h:290
std::vector< Product > products
The full list of products requested by this render.
Definition: spec.h:98
Specification of a product. See UsdRenderProduct.
Definition: spec.h:56
VtDictionary extraSettings
Any extra settings values discovered in requested namespaces.
Definition: spec.h:84
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1394
Definition: vec2f.h:63
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
TfToken aspectRatioConformPolicy
Definition: spec.h:71
float pixelAspectRatio
The pixel aspect ratio as adjusted by aspectRatioConformPolicy.
Definition: spec.h:68
VtDictionary extraSettings
Any extra settings values discovered in requested namespaces.
Definition: spec.h:106