Loading...
Searching...
No Matches
implicitSurface.h
1//
2// Copyright 2026 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_ST_IMPLICIT_SURFACE_H
8#define PXR_IMAGING_HD_ST_IMPLICIT_SURFACE_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hdSt/api.h"
12#include "pxr/imaging/hd/version.h"
13#include "pxr/imaging/hd/bufferSpec.h"
14#include "pxr/imaging/hd/drawingCoord.h"
15#include "pxr/imaging/hd/implicitSurface.h"
16#include "pxr/imaging/hd/perfLog.h"
17
18#include "pxr/usd/sdf/path.h"
19#include "pxr/base/vt/array.h"
20
21PXR_NAMESPACE_OPEN_SCOPE
22
23class HdStDrawItem;
24
30{
31public:
32 HDST_API
33 ~HdStImplicitSurface() override;
34
35 HDST_API
36 void UpdateRenderTag(HdSceneDelegate *delegate,
37 HdRenderParam *renderParam) override;
38
39 HDST_API
40 void Sync(HdSceneDelegate *delegate,
41 HdRenderParam *renderParam,
42 HdDirtyBits *dirtyBits,
43 TfToken const &reprToken) override;
44
45 HDST_API
46 void Finalize(HdRenderParam *renderParam) override;
47
48 HDST_API
49 HdDirtyBits GetInitialDirtyBitsMask() const override;
50
51protected:
52 HDST_API
54 TfToken const &primType,
55 HdBufferSpecVector customSpecs);
56
57 HDST_API
58 void _InitRepr(TfToken const &reprToken, HdDirtyBits *dirtyBits) override;
59
60 HDST_API
61 HdDirtyBits _PropagateDirtyBits(HdDirtyBits bits) const override;
62
63 void _UpdateRepr(HdSceneDelegate *sceneDelegate,
64 HdRenderParam *renderParam,
65 TfToken const &reprToken,
66 HdDirtyBits *dirtyBitsState);
67
68 void _UpdateDrawItem(HdSceneDelegate *sceneDelegate,
69 HdRenderParam *renderParam,
70 HdStDrawItem *drawItem,
71 HdDirtyBits *dirtyBits);
72
73 void _UpdateDrawItemGeometricShader(HdSceneDelegate *sceneDelegate,
74 HdRenderParam *renderParam,
75 HdStDrawItem *drawItem,
76 HdImplicitSurfaceReprDesc const &desc);
77
78 void _UpdateShadersForAllReprs(HdSceneDelegate *sceneDelegate,
79 HdRenderParam *renderParam,
80 bool updateMaterialNetworkShader,
81 bool updateGeometricShader);
82
83 void _UpdateMaterialTagsForAllReprs(HdSceneDelegate *sceneDelegate,
84 HdRenderParam *renderParam);
85
86 void _PopulateIndexBuffer(HdSceneDelegate *sceneDelegate,
87 HdRenderParam *renderParam,
88 HdStDrawItem *drawItem);
89
90 // Needs to be implemented by each prim-type-specific child class
91 virtual void _PopulateCustomConstantPrimvars(
92 HdSceneDelegate *sceneDelegate,
93 HdRenderParam *renderParam,
94 HdStDrawItem *drawItem) = 0;
95
96 // The type of implicit surface (e.g., sphere, cone)
97 const TfToken _primType;
98
99 // Buffer specs for prim-type-specific constant primvars (e.g., radius, height).
100 // Needs to be populated by each prim-type-specific child class.
101 const HdBufferSpecVector _customSpecs;
102
103private:
104 HdCullStyle _cullStyle{HdCullStyleDontCare};
105
106 // In the future, we might want to create a map for the vertex counts
107 // required for different reprs (such as points)
108 const uint32_t _vertexCount{4};
109
110 bool _doubleSided : 1;
111 bool _displayOpacityFromInstancer : 1;
112 bool _displayOpacityFromPrimvars : 1;
113 bool _displayInOverlay : 1;
114 bool _occludedSelectionShowsThrough : 1;
115
116 enum DrawingCoord {
117 InstancePrimvar = HdDrawingCoord::CustomSlotsBegin
118 };
119};
120
121
122PXR_NAMESPACE_CLOSE_SCOPE
123
124#endif // PXR_IMAGING_HD_ST_IMPLICIT_SURFACE_H
Hydra Schema for a natively supported implicit surface (e.g., spheres).
The HdRenderParam is an opaque (to core Hydra) handle, to an object that is obtained from the render ...
Adapter class providing data exchange with the client scene graph.
Base class for natively supported implicit surfaces (e.g., spheres)
HDST_API void Sync(HdSceneDelegate *delegate, HdRenderParam *renderParam, HdDirtyBits *dirtyBits, TfToken const &reprToken) override
Pull invalidated scene data and prepare/update the renderable representation.
HDST_API HdDirtyBits _PropagateDirtyBits(HdDirtyBits bits) const override
This callback from Rprim gives the prim an opportunity to set additional dirty bits based on those al...
HDST_API void _InitRepr(TfToken const &reprToken, HdDirtyBits *dirtyBits) override
Initialize the given representation of this Rprim.
HDST_API HdDirtyBits GetInitialDirtyBitsMask() const override
Returns the set of dirty bits that should be added to the change tracker for this prim,...
HDST_API void Finalize(HdRenderParam *renderParam) override
Finalizes object resources.
A path value used to locate objects in layers or scenegraphs.
Definition path.h:281
Token for efficient comparison, assignment, and hashing of known strings.
Definition token.h:81
Descriptor to configure the drawItem for a repr.