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 HD_AOV_H
25 #define 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 
119 
130 
133 
139 
142  HdAovSettingsMap aovSettings;
143 };
144 
145 typedef std::vector<HdRenderPassAovBinding> HdRenderPassAovBindingVector;
146 
147 // VtValue requirements for HdRenderPassAovBinding
148 HD_API
149 std::ostream& operator<<(std::ostream& out,
150  const HdRenderPassAovBinding& desc);
151 HD_API
152 bool operator==(const HdRenderPassAovBinding& lhs,
153  const HdRenderPassAovBinding& rhs);
154 HD_API
155 bool operator!=(const HdRenderPassAovBinding& lhs,
156  const HdRenderPassAovBinding& rhs);
157 
158 HD_API
159 size_t hash_value(const HdRenderPassAovBinding &b);
160 
161 
167  HD_API
169  HD_API
170  HdParsedAovToken(TfToken const& aovName);
171 
172  TfToken name;
173  bool isPrimvar : 1;
174  bool isLpe : 1;
175  bool isShader : 1;
176 };
177 typedef std::vector<HdParsedAovToken> HdParsedAovTokenVector;
178 
179 PXR_NAMESPACE_CLOSE_SCOPE
180 
181 #endif // 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:132
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:89
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:287
HdAovSettingsMap aovSettings
Extra settings for AOV rendering, such as pixel filtering options.
Definition: aov.h:142
TfToken aovName
The identifier of the renderer output to be consumed.
Definition: aov.h:118
HdRenderBuffer * renderBuffer
The render buffer to be bound to the above terminal output.
Definition: aov.h:129
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:166
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:48
A bundle of state describing an AOV (&quot;Alternate Output Value&quot;) display channel.
Definition: aov.h:46
VtValue clearValue
The clear value to apply to the bound render buffer, before rendering.
Definition: aov.h:138
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:182