From f87a12fd76ee61987eaae4e31b1bfd53eadb2e06 Mon Sep 17 00:00:00 2001 From: assiduous Date: Wed, 9 Oct 2024 19:08:04 -0700 Subject: [PATCH] Hydrogent: clip uniform images --- Hydrogent/src/HnMaterial.cpp | 2 +- Hydrogent/src/HnTextureRegistry.cpp | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Hydrogent/src/HnMaterial.cpp b/Hydrogent/src/HnMaterial.cpp index 3627c217..673e6403 100644 --- a/Hydrogent/src/HnMaterial.cpp +++ b/Hydrogent/src/HnMaterial.cpp @@ -311,7 +311,7 @@ void HnMaterial::InitTextureAttribs(HnTextureRegistry& TexRegistry, const USD_Re MatBuilder.Finalize(); } -static RefCntAutoPtr CreateDefaultImage(const pxr::TfToken& Name, Uint32 Dimension = 64) +static RefCntAutoPtr CreateDefaultImage(const pxr::TfToken& Name, Uint32 Dimension = 32) { ImageDesc ImgDesc; ImgDesc.Width = Dimension; diff --git a/Hydrogent/src/HnTextureRegistry.cpp b/Hydrogent/src/HnTextureRegistry.cpp index 8597ea55..ecc4708d 100644 --- a/Hydrogent/src/HnTextureRegistry.cpp +++ b/Hydrogent/src/HnTextureRegistry.cpp @@ -215,11 +215,12 @@ HnTextureRegistry::TextureHandleSharedPtr HnTextureRegistry::Allocate(const HnTe LoadInfo.Format = Format; // TODO: why do textures need to be flipped vertically? - LoadInfo.FlipVertically = !TexId.SubtextureId.FlipVertically; - LoadInfo.IsSRGB = TexId.SubtextureId.IsSRGB; - LoadInfo.PermultiplyAlpha = TexId.SubtextureId.PremultiplyAlpha; - LoadInfo.Swizzle = TexId.SubtextureId.Swizzle; - LoadInfo.CompressMode = CompressMode; + LoadInfo.FlipVertically = !TexId.SubtextureId.FlipVertically; + LoadInfo.IsSRGB = TexId.SubtextureId.IsSRGB; + LoadInfo.PermultiplyAlpha = TexId.SubtextureId.PremultiplyAlpha; + LoadInfo.Swizzle = TexId.SubtextureId.Swizzle; + LoadInfo.CompressMode = CompressMode; + LoadInfo.UniformImageClipDim = 32; return CreateTextureLoaderFromSdfPath(TexId.FilePath.GetText(), LoadInfo); });