aov.h
1 //
2 // Copyright 2018 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_IMAGING_HD_AOV_H
8 #define PXR_IMAGING_HD_AOV_H
9 
10 #include "pxr/pxr.h"
11 
12 #include "pxr/imaging/hd/api.h"
13 #include "pxr/imaging/hd/types.h"
14 #include "pxr/usd/sdf/path.h"
15 #include "pxr/base/gf/vec3i.h"
16 #include "pxr/base/tf/hashmap.h"
17 #include "pxr/base/vt/value.h"
18 
19 PXR_NAMESPACE_OPEN_SCOPE
20 
21 typedef TfHashMap<TfToken, VtValue, TfToken::HashFunctor> HdAovSettingsMap;
22 
30 {
32  : format(HdFormatInvalid), multiSampled(false)
33  , clearValue(), aovSettings() {}
34  HdAovDescriptor(HdFormat f, bool ms, VtValue const& c)
35  : format(f), multiSampled(ms), clearValue(c), aovSettings() {}
36 
37  // ----------------------------------------------------------------
38  // Render buffer parameters
39  // ----------------------------------------------------------------
40 
42  HdFormat format;
43 
47 
48  // ----------------------------------------------------------------
49  // Renderpass binding parameters.
50  // ----------------------------------------------------------------
51 
57 
60  HdAovSettingsMap aovSettings;
61 };
62 typedef std::vector<HdAovDescriptor> HdAovDescriptorList;
63 
68 
70  : dimensions(0), format(HdFormatInvalid), multiSampled(false) {}
71  HdRenderBufferDescriptor(GfVec3i const& _d, HdFormat _f, bool _ms)
72  : dimensions(_d), format(_f), multiSampled(_ms) {}
73 
76 
78  HdFormat format;
79 
83 
84  bool operator==(HdRenderBufferDescriptor const& rhs) const {
85  return dimensions == rhs.dimensions &&
86  format == rhs.format && multiSampled == rhs.multiSampled;
87  }
88  bool operator!=(HdRenderBufferDescriptor const& rhs) const {
89  return !(*this == rhs);
90  }
91 };
92 
97 
98 class HdRenderBuffer;
99 
101 
103  : renderBuffer(nullptr) {}
104 
111 
122 
125 
131 
134  HdAovSettingsMap aovSettings;
135 };
136 
137 typedef std::vector<HdRenderPassAovBinding> HdRenderPassAovBindingVector;
138 
139 // VtValue requirements for HdRenderPassAovBinding
140 HD_API
141 std::ostream& operator<<(std::ostream& out,
142  const HdRenderPassAovBinding& desc);
143 HD_API
144 bool operator==(const HdRenderPassAovBinding& lhs,
145  const HdRenderPassAovBinding& rhs);
146 HD_API
147 bool operator!=(const HdRenderPassAovBinding& lhs,
148  const HdRenderPassAovBinding& rhs);
149 
150 HD_API
151 size_t hash_value(const HdRenderPassAovBinding &b);
152 
154 HD_API
155 bool HdAovHasDepthSemantic(TfToken const& aovName);
156 
158 HD_API
159 bool HdAovHasDepthStencilSemantic(TfToken const& aovName);
160 
166  HD_API
168  HD_API
169  HdParsedAovToken(TfToken const& aovName);
170 
171  TfToken name;
172  bool isPrimvar : 1;
173  bool isLpe : 1;
174  bool isShader : 1;
175 };
176 typedef std::vector<HdParsedAovToken> HdParsedAovTokenVector;
177 
178 PXR_NAMESPACE_CLOSE_SCOPE
179 
180 #endif // PXR_IMAGING_HD_AOV_H
Describes the allocation structure of a render buffer bprim.
Definition: aov.h:67
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:46
VtValue clearValue
The clear value to apply to the render buffer before rendering.
Definition: aov.h:56
HdFormat format
The AOV output format. See also HdRenderBufferDescriptor::format.
Definition: aov.h:42
bool multiSampled
Whether the render buffer should be multisampled.
Definition: aov.h:82
SdfPath renderBufferId
The render buffer to be bound to the above terminal output.
Definition: aov.h:124
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:80
GfVec3i dimensions
The width, height, and depth of the allocated render buffer.
Definition: aov.h:75
HdFormat format
The data format of the render buffer. See also HdAovDescriptor::format.
Definition: aov.h:78
HdAovSettingsMap aovSettings
Extra settings for AOV rendering, such as pixel filtering options.
Definition: aov.h:60
Basic type for a vector of 3 int components.
Definition: vec3i.h:44
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:280
HdAovSettingsMap aovSettings
Extra settings for AOV rendering, such as pixel filtering options.
Definition: aov.h:134
TfToken aovName
The identifier of the renderer output to be consumed.
Definition: aov.h:110
HdRenderBuffer * renderBuffer
The render buffer to be bound to the above terminal output.
Definition: aov.h:121
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:100
Represents an AOV token which has been parsed to extract the prefix (in the case of "primvars:"/"lpe:...
Definition: aov.h:165
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:32
A bundle of state describing an AOV ("Arbitrary Output Variable") display channel.
Definition: aov.h:29
VtValue clearValue
The clear value to apply to the bound render buffer, before rendering.
Definition: aov.h:130
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:89