From 4f062fb58de1dc7275568becaf777942518c8929 Mon Sep 17 00:00:00 2001 From: Not Officer Date: Sun, 30 May 2021 00:53:02 +0200 Subject: [PATCH] another upscale case --- FModel/ViewModels/CUE4ParseViewModel.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/FModel/ViewModels/CUE4ParseViewModel.cs b/FModel/ViewModels/CUE4ParseViewModel.cs index fa25bdce..fe99eb1a 100644 --- a/FModel/ViewModels/CUE4ParseViewModel.cs +++ b/FModel/ViewModels/CUE4ParseViewModel.cs @@ -540,7 +540,8 @@ namespace FModel.ViewModels case UTexture2D texture: { var filter = texture.GetOrDefault("Filter"); - SetImage(texture.Decode(), filter.IsNone ? null : filter.Text); + var lodGroup = texture.GetOrDefault("LODGroup"); + SetImage(texture.Decode(), filter.IsNone ? null : filter.Text, lodGroup.IsNone ? null : lodGroup.Text); return true; } case UAkMediaAssetData: @@ -589,12 +590,14 @@ namespace FModel.ViewModels return false; } - private void SetImage(SKImage img, string filter = null) + private void SetImage(SKImage img, string filter = null, string lodGroup = null) { const int UPSCALE_SIZE = 512; SKData data; - if (filter != null && img.Width < UPSCALE_SIZE && img.Height < UPSCALE_SIZE && filter.EndsWith("TF_Nearest", StringComparison.Ordinal)) + if ((filter != null && filter.EndsWith("TF_Nearest", StringComparison.Ordinal) || + lodGroup != null && lodGroup.EndsWith("TEXTUREGROUP_Pixels2D", StringComparison.Ordinal)) && + img.Width < UPSCALE_SIZE && img.Height < UPSCALE_SIZE) { var width = img.Width; var heigth = img.Height;