Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ビルド中に生成したテクスチャの圧縮をアセット保存時まで遅延させたい #225

Open
kurotu opened this issue Apr 21, 2024 · 0 comments · May be fixed by #229
Open

Comments

@kurotu
Copy link
Contributor

kurotu commented Apr 21, 2024

TexTransToolやAAO、VRCQuestTools(作業中)などビルド中にテクスチャを生成するプラグインにおいて、現在はそれぞれの責任でテクスチャを圧縮しています。
プラグインの入力となるテクスチャが他のプラグインで生成されたテクスチャだった場合、圧縮済みのテクスチャから新たにテクスチャを生成することになり、圧縮の繰り返しによる画質劣化が懸念されます。また、最終的に使用しないテクスチャがあるため圧縮時間の無駄もあります。

プラグインで特別な配慮をしなくても、実際に使用するテクスチャだけをNDMF側で圧縮するようにしたいです。

class ExampleUserPlugin : Plugin<ExampleUserPlugin>
{
    protected override void Configure()
    {
        InPhase(BuildPhase.Transforming).Run("Generate textures", ctx => {
            // Do not need to compress generated textures in user plugins.
            var tex1 = GenerateTexture();

            // Can override format and quality.
            var tex2 = GenerateTexture();
            TextureCompressor.Register(tex2, TextureFormat.ASTC_8x8, TextureCompressionQuality.Best);

            // assign tex1 and tex2 to materials, etc.
        });
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant