Loading...
Searching...
No Matches
oitBufferAccessor.h
1//
2// Copyright 2019 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_HDX_OIT_BUFFER_ACCESSOR_H
8#define PXR_IMAGING_HDX_OIT_BUFFER_ACCESSOR_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hdx/api.h"
12#include "pxr/imaging/hdx/version.h"
13
14#include "pxr/imaging/hd/task.h"
15
16#include <memory>
17
18PXR_NAMESPACE_OPEN_SCOPE
19
20class Hgi;
21
22using HdBufferArrayRangeSharedPtr =
23 std::shared_ptr<class HdBufferArrayRange>;
24
25using HdStRenderPassShaderSharedPtr =
26 std::shared_ptr<class HdStRenderPassShader>;
27
30public:
31 HDX_API
32 static bool IsOitEnabled();
33
34 // This method helps improve the footprint of the OIT buffers by packing the
35 // color, transmission and depth into smaller buffers. This follows the
36 // theory in https://interplayoflight.wordpress.com/2022/06/25/order-independent-transparency-part-1/
37 // This compression results in a 4x reduction in the memory footprint of the
38 // OIT buffers at the cost of accuracy.
39 HDX_API
40 static bool IsOitPackedDepthEnabled();
41
42 HDX_API
43 HdxOitBufferAccessor(HdTaskContext *ctx);
44
46 HDX_API
48
50 HDX_API
52
56 HDX_API
57 bool AddOitBufferBindings(const HdStRenderPassShaderSharedPtr &);
58
59private:
60 HdBufferArrayRangeSharedPtr const &_GetBar(const TfToken &);
61
62 HdTaskContext * const _ctx;
63};
64
65PXR_NAMESPACE_CLOSE_SCOPE
66
67#endif
Class for OIT render tasks to access the OIT buffers.
HDX_API void InitializeOitBuffersIfNecessary(Hgi *hgi)
Called during Excecute before writing to OIT buffers.
HDX_API void RequestOitBuffers()
Called during Prepare to indicate that OIT buffers are needed.
HDX_API bool AddOitBufferBindings(const HdStRenderPassShaderSharedPtr &)
Called during Execute to add necessary OIT buffer shader bindings.
Hydra Graphics Interface.
Definition hgi.h:95
Token for efficient comparison, assignment, and hashing of known strings.
Definition token.h:71