SwizzleRoughnessToGreen

This commit is contained in:
4sval 2023-06-09 21:19:37 +02:00
parent 84f5d4d605
commit d4e2bf187f
3 changed files with 24 additions and 7 deletions

@ -1 +1 @@
Subproject commit 5b38fc685da2f574262d54639f687945660cdf00
Subproject commit f3ad3b3093f2693604415fa94ce9a53bb5a5c3fa

View File

@ -393,11 +393,10 @@ public class CUE4ParseViewModel : ViewModel
return Task.Run(() =>
{
var l = ELog.Information;
if (endpoint.Overwrite && File.Exists(endpoint.FilePath))
{
Provider.MappingsContainer = new FileUsmapTypeMappingsProvider(endpoint.FilePath);
FLogger.Append(ELog.Information, () =>
FLogger.Text($"Mappings pulled from '{endpoint.FilePath.SubstringAfterLast("\\")}'", Constants.WHITE, true));
}
else if (endpoint.IsValid)
{
@ -416,8 +415,6 @@ public class CUE4ParseViewModel : ViewModel
}
Provider.MappingsContainer = new FileUsmapTypeMappingsProvider(mappingPath);
FLogger.Append(ELog.Information, () =>
FLogger.Text($"Mappings pulled from '{mapping.FileName}'", Constants.WHITE, true));
break;
}
}
@ -429,10 +426,15 @@ public class CUE4ParseViewModel : ViewModel
var latestUsmapInfo = latestUsmaps.OrderBy(f => f.LastWriteTime).Last();
Provider.MappingsContainer = new FileUsmapTypeMappingsProvider(latestUsmapInfo.FullName);
FLogger.Append(ELog.Warning, () =>
FLogger.Text($"Mappings pulled from '{latestUsmapInfo.Name}'", Constants.WHITE, true));
l = ELog.Warning;
}
}
if (Provider.MappingsContainer is FileUsmapTypeMappingsProvider m)
{
Log.Information($"Mappings pulled from '{m.FileName}'");
FLogger.Append(l, () => FLogger.Text($"Mappings pulled from '{m.FileName}'", Constants.WHITE, true));
}
});
}

View File

@ -132,6 +132,21 @@ public class Material : IDisposable
"Emissive 2 UV Positioning (RG)UpperLeft (BA)LowerRight",
"EmissiveUVPositioning (RG)UpperLeft (BA)LowerRight"))
EmissiveRegion = new Vector4(EmissiveUVs.R, EmissiveUVs.G, EmissiveUVs.B, EmissiveUVs.A);
if (Parameters.TryGetSwitch(out var swizzleRoughnessToGreen, "SwizzleRoughnessToGreen") && swizzleRoughnessToGreen)
{
foreach (var specMask in SpecularMasks)
{
specMask.SwizzleMask = new []
{
(int) PixelFormat.Red,
(int) PixelFormat.Blue,
(int) PixelFormat.Green,
(int) PixelFormat.Alpha
};
specMask.Swizzle();
}
}
}
}
}