Kaynağa Gözat

[rtexture] Cubemap mipmap loading improvements (#4721)

* [rtextures] Only build cubemap mipmaps when necessary

* [rtextures] Assign correct mipmap count to cubemaps
pull/4723/head
Nikolas 9 ay önce
işlemeyi yapan: GitHub
ebeveyn
işleme
49d37b035f
Veri tabanında bu imza için bilinen anahtar bulunamadı GPG Anahtar Kimliği: B5690EEEBB952194
1 değiştirilmiş dosya ile 6 ekleme ve 3 silme
  1. +6
    -3
      src/rtextures.c

+ 6
- 3
src/rtextures.c Dosyayı Görüntüle

@ -4208,8 +4208,11 @@ TextureCubemap LoadTextureCubemap(Image image, int layout)
Image mipmapped = ImageCopy(image);
#if defined(SUPPORT_IMAGE_MANIPULATION)
ImageMipmaps(&mipmapped);
ImageMipmaps(&faces);
if (image.mipmaps > 1)
{
ImageMipmaps(&mipmapped);
ImageMipmaps(&faces);
}
#endif
// NOTE: Image formatting does not work with compressed textures
@ -4226,7 +4229,7 @@ TextureCubemap LoadTextureCubemap(Image image, int layout)
if (cubemap.id != 0)
{
cubemap.format = faces.format;
cubemap.mipmaps = mi">1;
cubemap.mipmaps = n">faces.mipmaps;
}
else TRACELOG(LOG_WARNING, "IMAGE: Failed to load cubemap image");

Yükleniyor…
İptal
Kaydet