mirror of
https://github.com/0x7c13/Pal3.Unity.git
synced 2026-11-26 17:38:10 +08:00
Separate file decoding from Unity upload through format-neutral texture data and explicit world, sprite and skybox policies. Validate DDS layouts, preserve alpha coverage and use native BC uploads with software RGBA fallback. Compact referenced POL vertices and batch nearby static opaque groups sharing materials. Keep water and dynamic geometry separate, with source ranges retained only in the Editor. Add DDS layout and POL index regression tests. Validation: PAL3 and PAL3A each passed 24 Editor tests, eight combined Game and ResourceViewer style regressions, 936 paired skybox comparisons, and both macOS Player builds on Metal. Editor provenance and Core tests are excluded from Players.
21 lines
748 B
C#
21 lines
748 B
C#
// ---------------------------------------------------------------------------------------------
|
|
// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved.
|
|
// See LICENSE file in the project root for license information.
|
|
// ---------------------------------------------------------------------------------------------
|
|
|
|
namespace Engine.DataLoader
|
|
{
|
|
using Core.Abstraction;
|
|
using Pal3.Core.DataReader.Dxt;
|
|
|
|
public sealed class DxtTextureLoader : ITextureLoader
|
|
{
|
|
public ITextureDataSource Load(byte[] data, out bool hasAlphaChannel)
|
|
{
|
|
var image = new DxtImage(data);
|
|
hasAlphaChannel = image.HasAlphaChannel;
|
|
return new DxtTextureDataSource(image);
|
|
}
|
|
}
|
|
}
|