All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
aov.h
1 //
2 // Copyright 2018 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_IMAGING_HD_AOV_H
25 #define PXR_IMAGING_HD_AOV_H
26 
27 #include "pxr/pxr.h"
28 
29 #include "pxr/imaging/hd/api.h"
30 #include "pxr/imaging/hd/types.h"
31 #include "pxr/usd/sdf/path.h"
32 #include "pxr/base/gf/vec3i.h"
33 #include "pxr/base/tf/hashmap.h"
34 #include "pxr/base/vt/value.h"
35 
36 PXR_NAMESPACE_OPEN_SCOPE
37 
38 typedef TfHashMap<TfToken, VtValue, TfToken::HashFunctor> HdAovSettingsMap;
39 
47 {
49  : format(HdFormatInvalid), multiSampled(false)
50  , clearValue(), aovSettings() {}
51  HdAovDescriptor(HdFormat f, bool ms, VtValue const& c)
52  : format(f), multiSampled(ms), clearValue(c), aovSettings() {}
53 
54  // ----------------------------------------------------------------
55  // Render buffer parameters
56  // ----------------------------------------------------------------
57 
59  HdFormat format;
60 
64 
65  // ----------------------------------------------------------------
66  // Renderpass binding parameters.
67  // ----------------------------------------------------------------
68 
74 
77  HdAovSettingsMap aovSettings;
78 };
79 typedef std::vector<HdAovDescriptor> HdAovDescriptorList;
80 
87 
89  HdFormat format;
90 
94 
95  bool operator==(HdRenderBufferDescriptor const& rhs) const {
96  return dimensions == rhs.dimensions &&
97  format == rhs.format && multiSampled == rhs.multiSampled;
98  }
99  bool operator!=(HdRenderBufferDescriptor const& rhs) const {
100  return !(*this == rhs);
101  }
102 };
103 
108 
109 class HdRenderBuffer;
110 
112 
114  : renderBuffer(nullptr) {}
115 
121 
132 
135 
141 
144  HdAovSettingsMap aovSettings;
145 };
146 
147 typedef std::vector<HdRenderPassAovBinding> HdRenderPassAovBindingVector;
148 
149 // VtValue requirements for HdRenderPassAovBinding
150 HD_API
151 std::ostream& operator<<(std::ostream& out,
152  const HdRenderPassAovBinding& desc);
153 HD_API
154 bool operator==(const HdRenderPassAovBinding& lhs,
155  const HdRenderPassAovBinding& rhs);
156 HD_API
157 bool operator!=(const HdRenderPassAovBinding& lhs,
158  const HdRenderPassAovBinding& rhs);
159 
160 HD_API
161 size_t hash_value(const HdRenderPassAovBinding &b);
162 
164 HD_API
165 bool HdAovHasDepthSemantic(TfToken const& aovName);
166 
172  HD_API
174  HD_API
175  HdParsedAovToken(TfToken const& aovName);
176 
177  TfToken name;
178  bool isPrimvar : 1;
179  bool isLpe : 1;
180  bool isShader : 1;
181 };
182 typedef std::vector<HdParsedAovToken> HdParsedAovTokenVector;
183 
184 PXR_NAMESPACE_CLOSE_SCOPE
185 
186 #endif // PXR_IMAGING_HD_AOV_H
Describes the allocation structure of a render buffer bprim.
Definition: aov.h:84
AR_API bool operator!=(const ArAssetInfo &lhs, const ArAssetInfo &rhs)
AR_API bool operator==(const ArAssetInfo &lhs, const ArAssetInfo &rhs)
bool multiSampled
Whether the render buffer should be multisampled.
Definition: aov.h:63
VtValue clearValue
The clear value to apply to the render buffer before rendering.
Definition: aov.h:73
HdFormat format
The AOV output format. See also HdRenderBufferDescriptor::format.
Definition: aov.h:59
bool multiSampled
Whether the render buffer should be multisampled.
Definition: aov.h:93
SdfPath renderBufferId
The render buffer to be bound to the above terminal output.
Definition: aov.h:134
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:87
GfVec3i dimensions
The width, height, and depth of the allocated render buffer.
Definition: aov.h:86
HdFormat format
The data format of the render buffer. See also HdAovDescriptor::format.
Definition: aov.h:89
HdAovSettingsMap aovSettings
Extra settings for AOV rendering, such as pixel filtering options.
Definition: aov.h:77
Basic type for a vector of 3 int components.
Definition: vec3i.h:61
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:288
HdAovSettingsMap aovSettings
Extra settings for AOV rendering, such as pixel filtering options.
Definition: aov.h:144
TfToken aovName
The identifier of the renderer output to be consumed.
Definition: aov.h:120
HdRenderBuffer * renderBuffer
The render buffer to be bound to the above terminal output.
Definition: aov.h:131
GF_API std::ostream & operator<<(std::ostream &, const GfBBox3d &)
Output a GfBBox3d using the format [(range) matrix zeroArea].
A renderpass AOV represents a binding of some output of the rendering process to an output buffer...
Definition: aov.h:111
Represents an AOV token which has been parsed to extract the prefix (in the case of &quot;primvars:&quot;/&quot;lpe:...
Definition: aov.h:171
A render buffer is a handle to a data resource that can be rendered into, such as a 2d image for a dr...
Definition: renderBuffer.h:51
A bundle of state describing an AOV (&quot;Arbitrary Output Variable&quot;) display channel.
Definition: aov.h:46
VtValue clearValue
The clear value to apply to the bound render buffer, before rendering.
Definition: aov.h:140
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:168