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

Function GetSubtextureIdentifier

Hydrogent/src/HnMaterialNetwork.cpp:595–623  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

593}
594
595HnSubTextureIdentifier GetSubtextureIdentifier(const pxr::TfToken& ParamName,
596 const pxr::HdTextureType& TextureType,
597 const pxr::TfToken& NodeType,
598 bool PremultiplyAlpha,
599 const pxr::TfToken& SourceColorSpace,
600 const TextureComponentMapping& Swizzle)
601{
602 HnSubTextureIdentifier TextureId;
603 TextureId.Type = TextureType;
604 TextureId.PremultiplyAlpha = PremultiplyAlpha;
605
606 if (SourceColorSpace == HnTokens->sRGB)
607 {
608 TextureId.IsSRGB = true;
609 }
610 else if (SourceColorSpace == "auto")
611 {
612 TextureId.IsSRGB = ParamName == HnTokens->diffuseColor || ParamName == HnTokens->emissiveColor;
613 }
614
615 if (TextureType == pxr::HdTextureType::Uv)
616 {
617 TextureId.FlipVertically = NodeType == HnMaterialPrivateTokens->HwUvTexture_1;
618 }
619
620 TextureId.Swizzle = Swizzle;
621
622 return TextureId;
623}
624
625HnMaterialParameter GetPrimvarReaderParam(const pxr::HdMaterialNetwork2& Network,
626 const pxr::HdMaterialNode2& Node,

Callers 1

AddTextureParamMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected