This document is for a version of USD that is under development. See this page for the current release.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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
19PXR_NAMESPACE_OPEN_SCOPE
20
21typedef 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};
62typedef 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
98class HdRenderBuffer;
99
101
103 : renderBuffer(nullptr) {}
104
111
122
125
131
134 HdAovSettingsMap aovSettings;
135};
136
137typedef std::vector<HdRenderPassAovBinding> HdRenderPassAovBindingVector;
138
139// VtValue requirements for HdRenderPassAovBinding
140HD_API
141std::ostream& operator<<(std::ostream& out,
142 const HdRenderPassAovBinding& desc);
143HD_API
144bool operator==(const HdRenderPassAovBinding& lhs,
145 const HdRenderPassAovBinding& rhs);
146HD_API
147bool operator!=(const HdRenderPassAovBinding& lhs,
148 const HdRenderPassAovBinding& rhs);
149
150HD_API
151size_t hash_value(const HdRenderPassAovBinding &b);
152
154HD_API
155bool HdAovHasDepthSemantic(TfToken const& aovName);
156
158HD_API
159bool 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};
176typedef std::vector<HdParsedAovToken> HdParsedAovTokenVector;
177
178PXR_NAMESPACE_CLOSE_SCOPE
179
180#endif // PXR_IMAGING_HD_AOV_H
Basic type for a vector of 3 int components.
Definition: vec3i.h:44
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:33
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:147
GF_API std::ostream & operator<<(std::ostream &, const GfBBox3d &)
Output a GfBBox3d using the format [(range) matrix zeroArea].
A bundle of state describing an AOV ("Arbitrary Output Variable") display channel.
Definition: aov.h:30
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
HdAovSettingsMap aovSettings
Extra settings for AOV rendering, such as pixel filtering options.
Definition: aov.h:60
Represents an AOV token which has been parsed to extract the prefix (in the case of "primvars:"/"lpe:...
Definition: aov.h:165
Describes the allocation structure of a render buffer bprim.
Definition: aov.h:67
bool multiSampled
Whether the render buffer should be multisampled.
Definition: aov.h:82
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
A renderpass AOV represents a binding of some output of the rendering process to an output buffer.
Definition: aov.h:100
HdRenderBuffer * renderBuffer
The render buffer to be bound to the above terminal output.
Definition: aov.h:121
VtValue clearValue
The clear value to apply to the bound render buffer, before rendering.
Definition: aov.h:130
SdfPath renderBufferId
The render buffer to be bound to the above terminal output.
Definition: aov.h:124
TfToken aovName
The identifier of the renderer output to be consumed.
Definition: aov.h:110
HdAovSettingsMap aovSettings
Extra settings for AOV rendering, such as pixel filtering options.
Definition: aov.h:134