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

Method CreateFallbackSprim

Hydrogent/src/HnRenderDelegate.cpp:434–462  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

432}
433
434pxr::HdSprim* HnRenderDelegate::CreateFallbackSprim(const pxr::TfToken& TypeId)
435{
436 pxr::HdSprim* SPrim = nullptr;
437 if (TypeId == pxr::HdPrimTypeTokens->material)
438 {
439 HnMaterial* Mat = HnMaterial::CreateFallback(m_TextureRegistry, *m_USDRenderer);
440 {
441 std::lock_guard<std::mutex> Guard{m_MaterialsMtx};
442 m_Materials.emplace(Mat);
443 }
444 SPrim = Mat;
445 }
446 else if (TypeId == pxr::HdPrimTypeTokens->camera ||
447 TypeId == pxr::HdPrimTypeTokens->simpleLight ||
448 TypeId == pxr::HdPrimTypeTokens->cylinderLight ||
449 TypeId == pxr::HdPrimTypeTokens->diskLight ||
450 TypeId == pxr::HdPrimTypeTokens->distantLight ||
451 TypeId == pxr::HdPrimTypeTokens->rectLight ||
452 TypeId == pxr::HdPrimTypeTokens->sphereLight ||
453 TypeId == pxr::HdPrimTypeTokens->domeLight)
454 {
455 SPrim = nullptr;
456 }
457 else
458 {
459 UNEXPECTED("Unexpected Sprim Type: ", TypeId.GetText());
460 }
461 return SPrim;
462}
463
464void HnRenderDelegate::DestroySprim(pxr::HdSprim* SPrim)
465{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected