MCPcopy Create free account
hub / github.com/DiligentGraphics/DiligentFX / SetDrawItemMaterial

Function SetDrawItemMaterial

Hydrogent/src/HnMesh.cpp:89–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89static void SetDrawItemMaterial(const pxr::HdRenderIndex& RenderIndex, HnDrawItem& DrawItem, const pxr::SdfPath& MaterialId)
90{
91 const pxr::HdSprim* pMaterial = RenderIndex.GetSprim(pxr::HdPrimTypeTokens->material, MaterialId);
92 if (pMaterial == nullptr)
93 {
94 pMaterial = RenderIndex.GetFallbackSprim(pxr::HdPrimTypeTokens->material);
95 VERIFY(pMaterial != nullptr, "Unable to get fallback material. This is unexpected as default material is initialized in the render delegate.");
96 }
97 if (pMaterial != nullptr)
98 {
99 DrawItem.SetMaterial(*static_cast<const HnMaterial*>(pMaterial));
100 }
101}
102
103
104template <typename HandleDrawItemFuncType, typename HandleGeomSubsetDrawItemFuncType>

Callers 1

UpdateReprMaterialsMethod · 0.85

Calls 1

SetMaterialMethod · 0.80

Tested by

no test coverage detected