**Refactor sRGB import option on textures** to actually handle image contents with gamma

This commit is contained in:
Wojtek Figat
2026-01-12 15:50:24 +01:00
parent 4b9fa0dcf5
commit b834dddb11
25 changed files with 196 additions and 54 deletions

View File

@@ -1334,6 +1334,7 @@ bool ModelTool::ImportModel(const String& path, ModelData& data, Options& option
String assetPath = GetAdditionalImportPath(autoImportOutput, importedFileNames, StringUtils::GetFileNameWithoutExtension(texture.FilePath));
#if COMPILE_WITH_ASSETS_IMPORTER
TextureTool::Options textureOptions;
textureOptions.sRGB = texture.sRGB;
switch (texture.Type)
{
case TextureEntry::TypeHint::ColorRGB:
@@ -1344,6 +1345,7 @@ bool ModelTool::ImportModel(const String& path, ModelData& data, Options& option
break;
case TextureEntry::TypeHint::Normals:
textureOptions.Type = TextureFormatType::NormalMap;
textureOptions.sRGB = false;
break;
}
AssetsImportingManager::ImportIfEdited(texture.FilePath, assetPath, texture.AssetID, &textureOptions);