24 #ifndef EXT_RMANPKG_24_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_CONTEXT_H
25 #define EXT_RMANPKG_24_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_CONTEXT_H
28 #include "hdPrman/api.h"
29 #include "hdPrman/xcpt.h"
32 #include "pxr/usd/sdf/path.h"
33 #include "pxr/imaging/hd/sceneDelegate.h"
34 #include "pxr/imaging/hd/coordSys.h"
38 #include <unordered_map>
46 #define HDPRMAN_MAX_TIME_SAMPLES 4
50 PXR_NAMESPACE_OPEN_SCOPE
55 class HdPrmanRenderDelegate;
58 struct HdPrman_Context
63 virtual ~HdPrman_Context();
71 typedef std::vector<riley::CoordinateSystemId> RileyCoordSysIdVec;
73 typedef std::shared_ptr<RileyCoordSysIdVec> RileyCoordSysIdVecRefPtr;
80 RileyCoordSysIdVecRefPtr ConvertAndRetainCoordSysBindings(
87 void ConvertCategoriesToAttributes(
95 void ReleaseCoordSysBindings(
SdfPath const&
id);
98 void IncrementLightLinkCount(
TfToken const& name);
101 void DecrementLightLinkCount(
TfToken const& name);
104 bool IsLightLinkUsed(
TfToken const& name);
107 void IncrementLightFilterCount(
TfToken const& name);
110 void DecrementLightFilterCount(
TfToken const& name);
113 bool IsLightFilterUsed(
TfToken const& name);
116 void SetOptionsFromRenderSettings(HdPrmanRenderDelegate *renderDelegate,
117 RtParamList& options);
121 void SetIntegratorParamsFromRenderSettings(
122 HdPrmanRenderDelegate *renderDelegate,
123 std::string& integratorName,
124 RtParamList& params);
130 void SetIntegratorParamsFromCamera(
131 HdPrmanRenderDelegate *renderDelegate,
133 std::string
const& integratorName,
134 RtParamList& params);
138 using IntegratorCameraCallback = void (*)
139 (HdPrmanRenderDelegate *renderDelegate,
141 std::string
const& integratorName,
142 RtParamList &integratorParams);
147 RegisterIntegratorCallbackForCamera(
148 IntegratorCameraCallback
const& callback);
151 bool IsShutterInstantaneous()
const;
154 void SetInstantaneousShutter(
bool instantaneousShutter);
157 bool IsXpu()
const {
return _xpu; }
167 RixRileyManager *mgr;
177 riley::MaterialId fallbackMaterial;
180 riley::MaterialId fallbackVolumeMaterial;
183 void _InitializePrman();
190 std::unordered_map<TfToken, size_t, TfToken::HashFunctor> _lightLinkRefs;
193 std::mutex _lightLinkMutex;
195 std::unordered_map<TfToken, size_t, TfToken::HashFunctor> _lightFilterRefs;
198 std::mutex _lightFilterMutex;
201 typedef std::unordered_map<
202 HdIdVectorSharedPtr, RileyCoordSysIdVecRefPtr>
203 _HdToRileyCoordSysMap;
205 typedef std::unordered_map<
206 SdfPath, HdIdVectorSharedPtr, SdfPath::Hash>
207 _GeomToHdCoordSysMap;
210 _GeomToHdCoordSysMap _geomToHdCoordSysMap;
211 _HdToRileyCoordSysMap _hdToRileyCoordSysMap;
212 std::mutex _coordSysMutex;
215 bool _instantaneousShutter;
223 HdPrman_GfMatrixToRtMatrix(
const GfMatrix4d &m)
227 d[0], d[1], d[2], d[3],
228 d[4], d[5], d[6], d[7],
229 d[8], d[9], d[10], d[11],
230 d[12], d[13], d[14], d[15]);
235 HdPrman_RtMatrixToGfMatrix(
const RtMatrix4x4 &m)
238 m.m[0][0], m.m[0][1], m.m[0][2], m.m[0][3],
239 m.m[1][0], m.m[1][1], m.m[1][2], m.m[1][3],
240 m.m[2][0], m.m[2][1], m.m[2][2], m.m[2][3],
241 m.m[3][0], m.m[3][1], m.m[3][2], m.m[3][3]);
247 RtPrimVarList& primvars,
int numUniform,
int numVertex,
248 int numVarying,
int numFaceVarying);
254 riley::MaterialId *materialId,
255 riley::DisplacementId *dispId);
268 HdPrman_UpdateSearchPathsFromEnvironment(RtParamList& options);
270 PXR_NAMESPACE_CLOSE_SCOPE
272 #endif // EXT_RMANPKG_24_0_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_CONTEXT_H
Defines an XcptHander for hdPrman.
Token for efficient comparison, assignment, and hashing of known strings.
Stores a 4x4 matrix of double elements.
Adapter class providing data exchange with the client scene graph.
A path value used to locate objects in layers or scenegraphs.
double * GetArray()
Returns vector components as an array of double values.
A representation for cameras that pulls on camera parameters used by Riley cameras.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...