MipMap generation for DXT1 TextureArray not working when the Texture has no auto-generated mips

未关闭
#357 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
42/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
csharp, unity

调研方向

Start in GUZ.Core.Services.Caches.TextureCacheService.TryGetTexture() and inspect how updateMipmaps is set from MipmapCount. Check how many affected DXT1 textures appear in G1 and G2 mods, then investigate Unity's texture array mip generation and the reported Graphics.CopyTexture dimension error. Done means mipmaps are generated for textures that lack them without causing dimension errors in the DXT1 texture array.

由索引模型根据 Issue 内容生成。

描述

improvement

Description

GUZ.Core.Services.Caches.TextureCacheService.TryGetTexture() has this information:

// TODO: DXT1 textures won't get MipMaps created. Unity limitation (even for v6.x). But normally all files do have MipMaps.
//  if (zkTexture.Format == ZenKit.TextureFormat.Dxt1 && zkTexture.MipmapCount == 1)
//  {
//    Logger.LogWarning($"Texture {zkTexture.Name} has no Mips and won't get one this way.", LogCat.Mesh);
//  }
// Let Unity generate Mipmaps if they aren't provided by Gothic texture itself.
var updateMipmaps = zkTexture.MipmapCount == 1;

Comment it out and see, how many textures are affected for G1/G2 Mods

If relevant, find a solution to generate the Mips. But be careful. What is not working:

  1. Create RGB24
  2. Create Mips
  3. Then put the RGB24 into the DXT1 TextureArray
    -> It will fail with an error, that the dimensions aren't correct (as DXT1 has less bytes per pixel).
Graphics.CopyTexture called with region not fitting in destination element: trying to copy to region on GPU (x:0, y:0, width:2048, height:2048) of mip 0 (size: 512x512)
主要语言
C#
星标
33
派生
1
平均合并
1 天 17 小时
30 天内合并 PR
51

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Gothic-Unity-Project/Gothic-Unity 的其他 Issue

查看 Gothic-Unity-Project/Gothic-Unity 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。