Skip to content

Commit

Permalink
Hydrogent: clip uniform images
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMostDiligent committed Oct 10, 2024
1 parent 2a32dc4 commit f87a12f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Hydrogent/src/HnMaterial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ void HnMaterial::InitTextureAttribs(HnTextureRegistry& TexRegistry, const USD_Re
MatBuilder.Finalize();
}

static RefCntAutoPtr<Image> CreateDefaultImage(const pxr::TfToken& Name, Uint32 Dimension = 64)
static RefCntAutoPtr<Image> CreateDefaultImage(const pxr::TfToken& Name, Uint32 Dimension = 32)
{
ImageDesc ImgDesc;
ImgDesc.Width = Dimension;
Expand Down
11 changes: 6 additions & 5 deletions Hydrogent/src/HnTextureRegistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down

0 comments on commit f87a12f

Please sign in to comment.