From 10b13fc8071247a8241a6975633b653122977f8d Mon Sep 17 00:00:00 2001 From: Fredrik Lindahl Date: Wed, 13 Nov 2024 18:34:27 +0100 Subject: [PATCH] Changed default max width and height in tex exporter --- toolkit/toolkitutil/model/import/gltf/ngltfexporter.cc | 6 ++++++ toolkit/toolkitutil/texutil/textureattrs.cc | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/toolkit/toolkitutil/model/import/gltf/ngltfexporter.cc b/toolkit/toolkitutil/model/import/gltf/ngltfexporter.cc index b3da45040..8277952b1 100644 --- a/toolkit/toolkitutil/model/import/gltf/ngltfexporter.cc +++ b/toolkit/toolkitutil/model/import/gltf/ngltfexporter.cc @@ -91,6 +91,8 @@ NglTFExporter::ParseScene() TextureAttrs attrs; attrs.SetPixelFormat(TextureAttrs::BC5); attrs.SetFlipNormalY(true); + attrs.SetMaxHeight(8192); + attrs.SetMaxWidth(8192); int32_t imageIndex = gltfScene.textures[material.normalTexture.index].source; Gltf::Image const& image = gltfScene.images[imageIndex]; @@ -115,6 +117,8 @@ NglTFExporter::ParseScene() TextureAttrs attrs; attrs.SetMipMapFilter(TextureAttrs::Filter::Kaiser); attrs.SetScaleFilter(TextureAttrs::Filter::Kaiser); + attrs.SetMaxHeight(8192); + attrs.SetMaxWidth(8192); attrs.SetColorSpace(TextureAttrs::sRGB); int32_t imageIndex = gltfScene.textures[material.pbrMetallicRoughness.baseColorTexture.index].source; @@ -140,6 +144,8 @@ NglTFExporter::ParseScene() TextureAttrs attrs; attrs.SetScaleFilter(TextureAttrs::Kaiser); attrs.SetMipMapFilter(TextureAttrs::Kaiser); + attrs.SetMaxHeight(8192); + attrs.SetMaxWidth(8192); int32_t imageIndex = gltfScene.textures[material.pbrMetallicRoughness.metallicRoughnessTexture.index].source; Gltf::Image const& image = gltfScene.images[imageIndex]; diff --git a/toolkit/toolkitutil/texutil/textureattrs.cc b/toolkit/toolkitutil/texutil/textureattrs.cc index 2efeb148c..2268ef2d4 100644 --- a/toolkit/toolkitutil/texutil/textureattrs.cc +++ b/toolkit/toolkitutil/texutil/textureattrs.cc @@ -14,8 +14,8 @@ using namespace Util; /** */ TextureAttrs::TextureAttrs() : - maxWidth(2048), - maxHeight(2048), + maxWidth(4096), + maxHeight(4096), genMipMaps(true), pixelFormat(BC7), mipMapFilter(Point),