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 HdImplicitSurfaceReprDesc const &desc);
73
74 void _UpdateDrawItemGeometricShader(HdSceneDelegate *sceneDelegate,
75 HdRenderParam *renderParam,
76 HdStDrawItem *drawItem,
77 HdImplicitSurfaceReprDesc const &desc);
78
79 void _UpdateShadersForAllReprs(HdSceneDelegate *sceneDelegate,
80 HdRenderParam *renderParam,
81 bool updateMaterialNetworkShader,
82 bool updateGeometricShader);
83
84 void _UpdateMaterialTagsForAllReprs(HdSceneDelegate *sceneDelegate,
85 HdRenderParam *renderParam);
86
87 void _PopulateIndexBuffer(HdSceneDelegate *sceneDelegate,
88 HdRenderParam *renderParam,
89 HdStDrawItem *drawItem,
90 HdImplicitSurfaceReprDesc const &desc);
91
92 // Needs to be implemented by each prim-type-specific child class
93 virtual void _PopulateCustomConstantPrimvars(
94 HdSceneDelegate *sceneDelegate,
95 HdRenderParam *renderParam,
96 HdStDrawItem *drawItem) = 0;
97
98 // The type of implicit surface (e.g., sphere, cone)
99 const TfToken _primType;
100
101 // Buffer specs for prim-type-specific constant primvars (e.g., radius, height).
102 // Needs to be populated by each prim-type-specific child class.
103 const HdBufferSpecVector _customSpecs;
104
105private:
106 HdCullStyle _cullStyle{HdCullStyleDontCare};
107
108 bool _doubleSided : 1;
109 bool _displayOpacityFromInstancer : 1;
110 bool _displayOpacityFromPrimvars : 1;
111 bool _displayInOverlay : 1;
112 bool _occludedSelectionShowsThrough : 1;
113 bool _pointsShadingEnabled : 1;
114
115 enum DrawingCoord {
116 InstancePrimvar = HdDrawingCoord::CustomSlotsBegin
117 };
118};
119
120
121PXR_NAMESPACE_CLOSE_SCOPE
122
123#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.