| 593 | } |
| 594 | |
| 595 | HnSubTextureIdentifier 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 | |
| 625 | HnMaterialParameter GetPrimvarReaderParam(const pxr::HdMaterialNetwork2& Network, |
| 626 | const pxr::HdMaterialNode2& Node, |