Loading...
Searching...
No Matches
sphere.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_SPHERE_H
8#define PXR_IMAGING_HD_ST_SPHERE_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/rprim.h"
14#include "pxr/imaging/hd/drawingCoord.h"
15#include "pxr/imaging/hd/enums.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
27class HdStSphere final : public HdRprim
28{
29public:
30 HF_MALLOC_TAG_NEW("new HdStSphere");
31
32 HDST_API
33 HdStSphere(SdfPath const& id);
34
35 HDST_API
36 ~HdStSphere() override;
37
38 HDST_API
39 TfTokenVector const & GetBuiltinPrimvarNames() const override;
40
41 HDST_API
42 void UpdateRenderTag(HdSceneDelegate *delegate,
43 HdRenderParam *renderParam) override;
44
45 HDST_API
46 void Sync(HdSceneDelegate *delegate,
47 HdRenderParam *renderParam,
48 HdDirtyBits *dirtyBits,
49 TfToken const &reprToken) override;
50
51 HDST_API
52 void Finalize(HdRenderParam *renderParam) override;
53
54 HDST_API
55 HdDirtyBits GetInitialDirtyBitsMask() const override;
56
57protected:
58 HDST_API
59 void _InitRepr(TfToken const &reprToken, HdDirtyBits *dirtyBits) override;
60
61 HDST_API
62 HdDirtyBits _PropagateDirtyBits(HdDirtyBits bits) const override;
63
64 void _UpdateRepr(HdSceneDelegate *sceneDelegate,
65 HdRenderParam *renderParam,
66 TfToken const &reprToken,
67 HdDirtyBits *dirtyBitsState);
68
69 void _UpdateDrawItem(HdSceneDelegate *sceneDelegate,
70 HdRenderParam *renderParam,
71 HdStDrawItem *drawItem,
72 HdDirtyBits *dirtyBits);
73
74 void _UpdateDrawItemGeometricShader(HdSceneDelegate *sceneDelegate,
75 HdRenderParam *renderParam,
76 HdStDrawItem *drawItem);
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 _PopulateCustomConstantPrimvars(HdSceneDelegate *sceneDelegate,
87 HdRenderParam *renderParam,
88 HdStDrawItem *drawItem);
89
90 void _PopulateIndexBuffer(HdSceneDelegate *sceneDelegate,
91 HdRenderParam *renderParam,
92 HdStDrawItem *drawItem);
93
94private:
95 HdReprSharedPtr _sphereDefaultRepr;
96
97 HdCullStyle _cullStyle;
98
99 // In the future, we might want to create a map for the vertex counts
100 // required for different reprs (such as wireframes)
101 const uint32_t _vertexCount;
102
103 bool _doubleSided : 1;
104 bool _displayOpacityFromInstancer : 1;
105 bool _displayOpacityFromPrimvars : 1;
106 bool _displayInOverlay : 1;
107 bool _occludedSelectionShowsThrough : 1;
108
109 enum DrawingCoord {
110 InstancePrimvar = HdDrawingCoord::CustomSlotsBegin
111 };
112};
113
114
115PXR_NAMESPACE_CLOSE_SCOPE
116
117#endif // PXR_IMAGING_HD_ST_SPHERE_H
The HdRenderParam is an opaque (to core Hydra) handle, to an object that is obtained from the render ...
The render engine state for a given rprim from the scene graph.
Definition rprim.h:38
Adapter class providing data exchange with the client scene graph.
Represents a sphere prim that can be rendered natively by Storm.
Definition sphere.h:28
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 TfTokenVector const & GetBuiltinPrimvarNames() const override
Returns the names of built-in primvars, i.e.
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:71
std::vector< TfToken > TfTokenVector
Convenience types.
Definition token.h:440