Loading...
Searching...
No Matches
gprim.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 EXT_RMANPKG_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_GPRIM_H
8#define EXT_RMANPKG_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_GPRIM_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hd/version.h"
12#include "pxr/usd/sdf/types.h"
15
16#include "hdPrman/cameraContext.h"
17#include "hdPrman/gprimbase.h"
18#include "hdPrman/idMap.h"
19#include "hdPrman/renderParam.h"
20#include "hdPrman/instancer.h"
21#include "hdPrman/material.h"
22#include "hdPrman/rixStrings.h"
23#include "hdPrman/utils.h"
24
25#include "Riley.h"
26#include <RiTypesHelper.h>
27
28PXR_NAMESPACE_OPEN_SCOPE
29
32template <typename BASE>
33class HdPrman_Gprim : public BASE, public HdPrman_GprimBase
34{
35public:
36 using BaseType = BASE;
37
38 HdPrman_Gprim(SdfPath const& id)
39 : BaseType(id)
40 {
41 }
42
43 ~HdPrman_Gprim() override = default;
44
45 void
46 Finalize(HdRenderParam *renderParam) override
47 {
48 HdPrman_RenderParam *param =
49 static_cast<HdPrman_RenderParam*>(renderParam);
50 const SdfPath& id = BASE::GetId();
51 riley::Riley *riley = param->AcquireRiley();
52 if (!riley) {
53 return;
54 }
55
56 // Release retained conversions of coordSys bindings.
57 param->ReleaseCoordSysBindings(id);
58
59 // Delete instances before deleting the prototypes they use.
60 for (const auto &instId: _instanceIds) {
61 if (instId != riley::GeometryInstanceId::InvalidId()) {
62 riley->DeleteGeometryInstance(
63 riley::GeometryPrototypeId::InvalidId(), instId);
64 }
65 }
66 _instanceIds.clear();
67
68 // Delete instances owned by the instancer.
69 if (HdPrmanInstancer* instancer = param->GetInstancer(
70 BASE::GetInstancerId())) {
71 instancer->Depopulate(renderParam, id);
72 }
73
74 // For mesh lights, finalize the light (and therefore its instances)
75 // before the geometry prototype is deleted below.
76 if (_PrototypeOnly()) {
77 param->FinalizeMeshLightSprim(id);
78 }
79
80 for (const auto &protoId: _prototypeIds) {
81 if (protoId != riley::GeometryPrototypeId::InvalidId()) {
82 riley->DeleteGeometryPrototype(protoId);
83 }
84 }
85 _prototypeIds.clear();
86 }
87
88 void Sync(HdSceneDelegate* sceneDelegate,
89 HdRenderParam* renderParam,
90 HdDirtyBits* dirtyBits,
91 TfToken const &reprToken) override;
92
93protected:
94 HdDirtyBits GetInitialDirtyBitsMask() const override = 0;
95
96 HdDirtyBits
97 _PropagateDirtyBits(HdDirtyBits bits) const override
98 {
99 // By default, just return the same dirty bits we recieved.
100 return bits;
101 }
102
103 void
104 _InitRepr(TfToken const &reprToken,
105 HdDirtyBits *dirtyBits) override
106 {
107 TF_UNUSED(reprToken);
108 TF_UNUSED(dirtyBits);
109 // No-op
110 }
111
112 // We override this member function in mesh.cpp to support the creation
113 // of mesh light prototype geometry.
114 virtual bool
115 _PrototypeOnly()
116 {
117 return false;
118 }
119
120 // Provide a fallback material. Default grabs _fallbackMaterial
121 // from the context.
122 virtual riley::MaterialId
123 _GetFallbackMaterial(HdPrman_RenderParam *renderParam)
124 {
125 return renderParam->GetFallbackMaterialId();
126 }
127
128 // Populate primType, primvars, and geometry subsets.
129 // Returns true if successful.
130 virtual bool
131 _ConvertGeometry(
132 HdPrman_RenderParam *renderParam,
133 HdSceneDelegate *sceneDelegate,
134 const SdfPath &id,
135 RtUString *primType,
136 RtPrimVarList *primvars,
137 std::vector<HdGeomSubset> *geomSubsets,
138 std::vector<RtPrimVarList> *geomSubsetPrimvars) = 0;
139
140 // Allow subclasses to inject additional geometry primvars.
141 virtual void
142 _AddPrimvars(RtPrimVarList*) const
143 {
144 // Add nothing by default.
145 }
146
147 // Allow subclasses to contribute additional coordinate system IDs.
148 virtual const std::vector<riley::CoordinateSystemId>&
149 _GetAdditionalCoordSysIds() const
150 {
151 static const std::vector<riley::CoordinateSystemId> empty;
152 return empty;
153 }
154
155 static
156 void
157 _ResolveDicingCamera(
158 const HdPrman_CameraContext& context,
159 RtPrimVarList* primvars)
160 {
161 // NB: We do not allow motion samples on dice:referencecamera
162 RtUString authored;
163 if (primvars->GetString(RixStr.k_dice_referencecamera, authored) &&
164 !authored.Empty()) {
165 const RtUString& resolved = context.ResolveCameraName(
166 authored.CStr());
167 if (resolved.Empty()) {
168 // A generic warning was already issued by ResolveCameraName()
169 primvars->Remove(RixStr.k_dice_referencecamera);
170 } else {
171 primvars->SetString(RixStr.k_dice_referencecamera, resolved);
172 }
173 }
174 }
175
176 // This class does not support copying.
177 HdPrman_Gprim(const HdPrman_Gprim&) = delete;
178 HdPrman_Gprim &operator =(const HdPrman_Gprim&) = delete;
179
180};
181
182template <typename BASE>
183void
185 HdRenderParam* renderParam,
186 HdDirtyBits* dirtyBits,
187 TfToken const &reprToken)
188{
189 HD_TRACE_FUNCTION();
190 TF_UNUSED(reprToken);
191
192 // Check if there are any relevant dirtyBits.
193 // (See the HdChangeTracker::MarkRprimDirty() note regarding
194 // internalDirtyBits used for internal signaling in Hydra.)
195 static const HdDirtyBits internalDirtyBits =
196 HdChangeTracker::InitRepr |
197 HdChangeTracker::Varying |
198 HdChangeTracker::NewRepr |
199 HdChangeTracker::CustomBitsMask;
200 // HdPrman does not make use of the repr concept or customBits.
201 *dirtyBits &= ~(HdChangeTracker::NewRepr | HdChangeTracker::CustomBitsMask);
202 // If no relevant dirtyBits remain, return early to avoid acquiring write
203 // access to Riley, which requires a pause and restart of rendering.
204 if (((*dirtyBits & ~internalDirtyBits)
205 & HdChangeTracker::AllSceneDirtyBits) == 0) {
206 return;
207 }
208
209 HdPrman_RenderParam *param =
210 static_cast<HdPrman_RenderParam*>(renderParam);
211
212 // Riley API.
213 riley::Riley *riley = param->AcquireRiley();
214
215 // Update instance bindings.
216 BASE::_UpdateInstancer(sceneDelegate, dirtyBits);
217
218 // Prim id
219 SdfPath const& id = BASE::GetId();
220 SdfPath const& instancerId = BASE::GetInstancerId();
221 const bool isHdInstance = !instancerId.IsEmpty();
222 SdfPath primPath = sceneDelegate->GetScenePrimPath(id, 0, nullptr);
223
224 // Sample transform
226 sceneDelegate->SampleTransform(id,
227#if HD_API_VERSION >= 68
228 param->GetShutterInterval()[0],
229 param->GetShutterInterval()[1],
230#endif
231 &xf);
232
233 // Update visibility so thet rprim->IsVisible() will work in render pass
234 if (HdChangeTracker::IsVisibilityDirty(*dirtyBits, id)) {
235 BASE::_UpdateVisibility(sceneDelegate, dirtyBits);
236 }
237
238 // Resolve material binding. Default to fallbackGprimMaterial.
239 if (*dirtyBits & HdChangeTracker::DirtyMaterialId) {
240#if HD_API_VERSION < 37
241 BASE::_SetMaterialId(sceneDelegate->GetRenderIndex().GetChangeTracker(),
242 sceneDelegate->GetMaterialId(id));
243#else
244 BASE::SetMaterialId(sceneDelegate->GetMaterialId(id));
245#endif
246 }
247 riley::MaterialId materialId = _GetFallbackMaterial(param);
248 riley::DisplacementId dispId = riley::DisplacementId::InvalidId();
249 const SdfPath & hdMaterialId = BASE::GetMaterialId();
250 HdPrman_ResolveMaterial(sceneDelegate, hdMaterialId, riley, &materialId, &dispId);
251
252 // Convert (and cache) coordinate systems.
253 riley::CoordinateSystemList coordSysList = {0, nullptr};
254 std::vector<riley::CoordinateSystemId> allCoordSysIds;
255 if (HdPrman_RenderParam::RileyCoordSysIdVecRefPtr convertedCoordSys =
256 param->ConvertAndRetainCoordSysBindings(sceneDelegate, id)) {
257 allCoordSysIds.insert(allCoordSysIds.end(),
258 convertedCoordSys->begin(),
259 convertedCoordSys->end());
260 }
261 // Append any additional coordinate system IDs from subclasses.
262 const auto& additionalCoordSysIds = _GetAdditionalCoordSysIds();
263 allCoordSysIds.insert(allCoordSysIds.end(),
264 additionalCoordSysIds.begin(),
265 additionalCoordSysIds.end());
266 coordSysList.count = allCoordSysIds.size();
267 coordSysList.ids = allCoordSysIds.data();
268
269 // Hydra dirty bits corresponding to PRMan prototype attributes (also called
270 // "primitive variables" but not synonymous with USD primvars). See prman
271 // docs at https://rmanwiki.pixar.com/display/REN24/Primitive+Variables.
272 static const HdDirtyBits prmanProtoAttrBits =
273 HdChangeTracker::DirtyPoints |
274 HdChangeTracker::DirtyNormals |
275 HdChangeTracker::DirtyWidths |
276 HdChangeTracker::DirtyVolumeField |
277 HdChangeTracker::DirtyTopology |
278 HdChangeTracker::DirtyPrimvar;
279
280 // Hydra dirty bits corresponding to prman instance attributes. See prman
281 // docs at https://rmanwiki.pixar.com/display/REN24/Instance+Attributes.
282 static const HdDirtyBits prmanInstAttrBits =
283 HdChangeTracker::DirtyMaterialId |
284 HdChangeTracker::DirtyTransform |
285 HdChangeTracker::DirtyVisibility |
286 HdChangeTracker::DirtyDoubleSided |
287 HdChangeTracker::DirtySubdivTags |
288 HdChangeTracker::DirtyVolumeField |
289 HdChangeTracker::DirtyCategories |
290 HdChangeTracker::DirtyPrimvar |
291 HdChangeTracker::DirtyRenderTag;
292
293 // These two bitmasks intersect, so we check them against dirtyBits
294 // prior to clearing either mask.
295 const bool prmanProtoAttrBitsWereSet(*dirtyBits & prmanProtoAttrBits);
296 const bool prmanInstAttrBitsWereSet(*dirtyBits & prmanInstAttrBits);
297
298 //
299 // Create or modify Riley geometry prototype(s).
300 //
301 std::vector<riley::MaterialId> subsetMaterialIds;
302 std::vector<SdfPath> subsetPaths;
303 {
304 TfAutoMallocTag mallocTag("hdPrman", "Geometry Prototypes");
305
306 RtUString primType;
307 RtPrimVarList primvars;
308 HdGeomSubsets geomSubsets;
309 std::vector<RtPrimVarList> geomSubsetPrimvars;
310 bool ok = _ConvertGeometry(param, sceneDelegate, id,
311 &primType, &primvars,
312 &geomSubsets, &geomSubsetPrimvars);
313 if (!ok) {
314 // We expect a specific error will have already been issued.
315 return;
316 }
317
318 // identifier:object is useful for cryptomatte
319 primvars.SetString(RixStr.k_identifier_object,
320 RtUString(id.GetText()));
321 for (size_t i=0, n=geomSubsets.size(); i<n; ++i) {
322 geomSubsetPrimvars[i]
323 .SetString(RixStr.k_identifier_object,
324 RtUString(geomSubsets[i].id.GetText()));
325 }
326
327// In 2311 and beyond, we can use
328// HdPrman_PreviewSurfacePrimvarsSceneIndexPlugin.
329#if PXR_VERSION < 2311
330 // Transfer material opinions of primvars.
331 HdPrman_TransferMaterialPrimvarOpinions(sceneDelegate, hdMaterialId,
332 primvars);
333#endif // PXR_VERSION < 2311
334
335 // Adjust _prototypeIds array.
336 const size_t oldCount = _prototypeIds.size();
337 const size_t newCount = std::max((size_t) 1, geomSubsets.size());
338 if (newCount != oldCount) {
339 for (const auto &oldPrototypeId: _prototypeIds) {
340 if (oldPrototypeId != riley::GeometryPrototypeId::InvalidId()) {
341 riley->DeleteGeometryPrototype(oldPrototypeId);
342 }
343 }
344 _prototypeIds.resize(newCount,
345 riley::GeometryPrototypeId::InvalidId());
346 }
347
348 const HdPrman_CameraContext& cameraContext = param->GetCameraContext();
349 _ResolveDicingCamera(cameraContext, &primvars);
350 for (RtPrimVarList& subsetPrimvars : geomSubsetPrimvars) {
351 // XXX: geom subsets can, theoretically, have different dicing
352 // cameras since they're implemented as separate geometry
353 // prototypes, but even if they couldn't this is important to
354 // ensure they all get set correctly if the parent geometry
355 // specifies a dicing camera.
356 _ResolveDicingCamera(cameraContext, &subsetPrimvars);
357 }
358
359 _AddPrimvars(&primvars);
360
361 // Update Riley geom prototypes.
362 if (geomSubsets.empty()) {
363 // Common case: no subsets.
364 TF_VERIFY(newCount == 1);
365 TF_VERIFY(_prototypeIds.size() == 1);
366 primvars.SetString(RixStr.k_stats_prototypeIdentifier,
367 RtUString(primPath.GetText()));
368 if (_prototypeIds[0] == riley::GeometryPrototypeId::InvalidId()) {
369 TRACE_SCOPE("riley::CreateGeometryPrototype");
370 _prototypeIds[0] = riley->CreateGeometryPrototype(
371 riley::UserId(
372 stats::AddDataLocation(primPath.GetText()).GetValue()),
373 primType, dispId, primvars);
374 } else if (prmanProtoAttrBitsWereSet) {
375 TRACE_SCOPE("riley::ModifyGeometryPrototype");
376 riley->ModifyGeometryPrototype(primType, _prototypeIds[0],
377 &dispId, &primvars);
378 }
379 } else {
380 // Subsets case.
381 // We resolve materials here, and hold them in subsetMaterialIds:
382 // Displacement networks are passed to the geom prototype;
383 // material networks are passed to the instances.
384 subsetMaterialIds.reserve(geomSubsets.size());
385
386 // We also cache the subset paths for re-use when creating
387 // the instances
388 subsetPaths.reserve(geomSubsets.size());
389
390 for (size_t j=0; j < geomSubsets.size(); ++j) {
391 auto& prototypeId = _prototypeIds[j];
392 HdGeomSubset &subset = geomSubsets[j];
393 RtPrimVarList &subsetPrimvars = geomSubsetPrimvars[j];
394
395 // Convert indices to int32_t and set as k_shade_faceset.
396 std::vector<int32_t> int32Indices(subset.indices.cbegin(),
397 subset.indices.cend());
398 subsetPrimvars.SetIntegerArray(RixStr.k_shade_faceset,
399 int32Indices.data(),
400 int32Indices.size());
401 // Look up material override for the subset (if any)
402 riley::MaterialId subsetMaterialId = materialId;
403 riley::DisplacementId subsetDispId = dispId;
404 if (subset.materialId.IsEmpty()) {
405 subset.materialId = hdMaterialId;
406 }
407 HdPrman_ResolveMaterial(
408 sceneDelegate, subset.materialId,
409 riley, &subsetMaterialId, &subsetDispId);
410 subsetMaterialIds.push_back(subsetMaterialId);
411
412 // Look up the path for the subset
413 const SdfPath subsetPath =
414 sceneDelegate->GetScenePrimPath(subset.id, 0, nullptr);
415 subsetPaths.push_back(subsetPath);
416 subsetPrimvars.SetString(
417 RixStr.k_stats_prototypeIdentifier,
418 RtUString(subsetPath.GetText()));
419
420 if (prototypeId == riley::GeometryPrototypeId::InvalidId()) {
421 TRACE_SCOPE("riley::CreateGeometryPrototype");
422 prototypeId =
423 riley->CreateGeometryPrototype(
424 riley::UserId(
425 stats::AddDataLocation(
426 subsetPath.GetText()).GetValue()),
427 primType, subsetDispId, subsetPrimvars);
428 } else if (prmanProtoAttrBitsWereSet) {
429 TRACE_SCOPE("riley::ModifyGeometryPrototype");
430 riley->ModifyGeometryPrototype(
431 primType, prototypeId,
432 &subsetDispId, &subsetPrimvars);
433 }
434 }
435 }
436 *dirtyBits &= ~prmanProtoAttrBits;
437 }
438
439 //
440 // Stop here, or also create geometry instances?
441 //
442 if (_PrototypeOnly()) {
443 *dirtyBits &= ~HdChangeTracker::AllSceneDirtyBits;
444 return;
445 }
446
447 //
448 // Create or modify Riley geometry instances.
449 //
450 TfAutoMallocTag mallocTag("hdPrman", "Geometry Instances");
451
452 // Resolve attributes.
453 RtParamList attrs = param->ConvertAttributes(sceneDelegate, id, true);
454
455 // user:__materialid is useful for cryptomatte
456 if(!hdMaterialId.IsEmpty()) {
457 attrs.SetString(RtUString("user:__materialid"), RtUString(hdMaterialId.GetText()));
458 }
459
460 if (!isHdInstance) {
461 // Simple case: Singleton instance.
462 // Convert transform.
464 for (size_t i=0; i < xf.count; ++i) {
465 xf_rt[i] = HdPrman_Utils::GfMatrixToRtMatrix(xf.values[i]);
466 }
467 const riley::Transform xform = {
468 unsigned(xf.count),
469 xf_rt.data(),
470 xf.times.data()};
471
472 // Adjust _instanceIds array.
473 const size_t oldCount = _instanceIds.size();
474 const size_t newCount = _prototypeIds.size();
475 if (newCount != oldCount) {
476 for (const auto &oldInstanceId: _instanceIds) {
477 if (oldInstanceId != riley::GeometryInstanceId::InvalidId()) {
478 riley->DeleteGeometryInstance(
479 riley::GeometryPrototypeId::InvalidId(), oldInstanceId);
480 }
481 }
482 _instanceIds.resize(
483 newCount,
484 riley::GeometryInstanceId::InvalidId());
485 }
486
487 // Prepend renderTag to grouping:membership
488 param->AddRenderTagToGroupingMembership(
489 sceneDelegate->GetRenderTag(id), attrs);
490
491 // Create or modify Riley instances corresponding to a
492 // singleton Hydra instance.
493 TF_VERIFY(_instanceIds.size() == _prototypeIds.size());
494 for (size_t j=0; j < _prototypeIds.size(); ++j) {
495 auto const& prototypeId = _prototypeIds[j];
496 auto& instanceId = _instanceIds[j];
497 auto instanceMaterialId = materialId;
498 RtParamList finalAttrs = attrs; // copy
499
500 // To uniquely identiy this geometry instance, use either
501 // the prim path or geometry subset path (if given).
502 SdfPath* idPath(&primPath);
503 if (!subsetPaths.empty()) {
504 idPath = &subsetPaths[j];
505 }
506
507 // Assign & register ID.
508 param->GetIdMap()->RegisterId(
509 { idPath->GetString(),
510 /* primId = */ BASE::GetPrimId(),
511 /*instanceId = */ 0 },
512 &finalAttrs);
513
514 // If a valid subset material was bound, use it.
515 if (!subsetMaterialIds.empty()) {
516 TF_VERIFY(j < subsetMaterialIds.size());
517 instanceMaterialId = subsetMaterialIds[j];
518 }
519
520 // Create or modify Riley geometry instance.
521 if (instanceId == riley::GeometryInstanceId::InvalidId()) {
522 TRACE_SCOPE("riley::CreateGeometryInstance");
523 instanceId = riley->CreateGeometryInstance(
524 riley::UserId(
525 stats::AddDataLocation(idPath->GetText()).GetValue()),
526 riley::GeometryPrototypeId::InvalidId(), prototypeId,
527 instanceMaterialId, coordSysList, xform, finalAttrs);
528 } else if (prmanInstAttrBitsWereSet) {
529 TRACE_SCOPE("riley::ModifyGeometryInstance");
530 riley->ModifyGeometryInstance(
531 riley::GeometryPrototypeId::InvalidId(),
532 instanceId, &instanceMaterialId, &coordSysList, &xform,
533 &finalAttrs);
534 }
535 }
536 *dirtyBits &= ~prmanInstAttrBits;
537 } else if (prmanInstAttrBitsWereSet
538 || HdChangeTracker::IsInstancerDirty(*dirtyBits, instancerId)) {
539 // This gprim is a prototype of a hydra instancer. (It is not itself an
540 // instancer because it is a gprim.) The riley geometry prototypes have
541 // already been synced above, and those are owned by this gprim instance.
542 // We need to tell the hdprman instancer to sync its riley instances for
543 // these riley prototypes.
544 //
545 // We won't make any riley instances here. The hdprman instancer will
546 // own the riley instances instead.
547 //
548 // We only need to do this if dirtyBits says the instancer is dirty.
549
550 HdRenderIndex &renderIndex = sceneDelegate->GetRenderIndex();
551
552 // first, sync the hydra instancer and its parents, from the bottom up.
553 // (note: this is transitional code, it should be done by the render index...)
554 HdInstancer::_SyncInstancerAndParents(renderIndex, instancerId);
555
556 if (subsetMaterialIds.size() == 0) {
557 subsetMaterialIds.push_back(materialId);
558 }
559 if (subsetPaths.size() == 0) {
560 subsetPaths.push_back(primPath);
561 }
562 TF_VERIFY(_prototypeIds.size() == subsetMaterialIds.size() &&
563 _prototypeIds.size() == subsetPaths.size(),
564 "size mismatch (%lu, %lu, %lu)\n", _prototypeIds.size(),
565 subsetMaterialIds.size(), subsetPaths.size());
566
567 // XXX: To avoid a failed verify inside Populate(), we will check the
568 // prototype ids for validity here. We don't usually do this, relying on
569 // Riley to report invalid prototype ids on instance creation. But
570 // Populate() allows and expects an invalid prototype id when instancing
571 // lights, so doing this check here lets us make a more informative
572 // warning. HYD-3206
573 if (std::any_of(_prototypeIds.begin(), _prototypeIds.end(),
574 [](const auto& id){
575 return id == riley::GeometryPrototypeId::InvalidId();
576 })) {
577 TF_WARN("Riley geometry prototype creation failed for "
578 "instanced gprim <%s>; the prim will not be instanced.",
579 id.GetText());
580 } else {
581 // next, tell the hdprman instancer to sync the riley instances
582 HdPrmanInstancer *instancer = static_cast<HdPrmanInstancer*>(
583 renderIndex.GetInstancer(instancerId));
584 if (instancer) {
585 instancer->Populate(
586 renderParam,
587 *dirtyBits,
588 id,
589 _prototypeIds,
590 coordSysList,
591 attrs, xf,
592 subsetMaterialIds,
593 subsetPaths);
594 }
595 }
596 }
597 *dirtyBits &= ~HdChangeTracker::AllSceneDirtyBits;
598}
599
600PXR_NAMESPACE_CLOSE_SCOPE
601
602#endif // EXT_RMANPKG_PLUGIN_RENDERMAN_PLUGIN_HD_PRMAN_GPRIM_H
Tracks changes from the HdSceneDelegate, providing invalidation cues to the render engine.
static HD_API bool IsInstancerDirty(HdDirtyBits dirtyBits, SdfPath const &id)
Returns true if the dirtyBits has a dirty instancer. id is for perflog.
HD_API bool IsVisibilityDirty(SdfPath const &id)
Returns true if the rprim identified by id has dirty visibility.
A common base class for HdPrman_Gprim types.
Definition gprimbase.h:22
A mix-in template that adds shared gprim behavior to support various HdRprim types.
Definition gprim.h:34
The render index is part of the Hydra 1.0 API and is only used for emulation purposes so that HdScene...
HD_API HdInstancer * GetInstancer(SdfPath const &id) const
Returns the instancer of id.
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.
virtual HD_API TfToken GetRenderTag(SdfPath const &id)
Returns the render tag that will be used to bucket prims during render pass bucketing.
virtual HD_API SdfPath GetMaterialId(SdfPath const &rprimId)
Returns the material ID bound to the rprim rprimId.
virtual HD_API size_t SampleTransform(SdfPath const &id, size_t maxSampleCount, float *sampleTimes, GfMatrix4d *sampleValues)
Store up to maxSampleCount transform samples in *sampleValues.
HdRenderIndex & GetRenderIndex()
Returns the RenderIndex owned by this delegate.
virtual HD_API SdfPath GetScenePrimPath(SdfPath const &rprimId, int instanceIndex, HdInstancerContext *instancerContext=nullptr)
Returns the scene address of the prim corresponding to the given rprim/instance index.
A path value used to locate objects in layers or scenegraphs.
Definition path.h:281
SDF_API const char * GetText() const
Returns the string representation of this path as a c string.
bool IsEmpty() const noexcept
Returns true if this is the empty path (SdfPath::EmptyPath()).
Definition path.h:405
Scoped (i.e.
Definition mallocTag.h:251
This is a small-vector class with local storage optimization, the local storage can be specified via ...
Token for efficient comparison, assignment, and hashing of known strings.
Definition token.h:81
#define TF_WARN(...)
Issue a warning, but continue execution.
Definition diagnostic.h:133
#define TF_VERIFY(cond, format,...)
Checks a condition and reports an error if it evaluates false.
Definition diagnostic.h:267
#define TF_UNUSED(x)
Stops compiler from producing unused argument or variable warnings.
Definition tf.h:168
Describes a subset of a piece of geometry as a set of indices.
Definition geomSubset.h:23
VtIntArray indices
The list of element indices contained in the subset.
Definition geomSubset.h:39
SdfPath id
The path used to identify this subset in the scene.
Definition geomSubset.h:35
SdfPath materialId
The path used to identify this material bound to the subset.
Definition geomSubset.h:37
An array of a value sampled over time, in struct-of-arrays layout.
Basic Sdf data types.