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

Đang mở
#357 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
42/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
csharp, unity
Lĩnh vực
game-dev, performance

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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)
Ngôn ngữ chính
C#
Star
33
Fork
1
Merge trung bình
1 ngày 17 giờ
Pull request đã merge (30 ngày)
51

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Gothic-Unity-Project/Gothic-Unity

Tất cả issue của Gothic-Unity-Project/Gothic-Unity

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.