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

[1.17, 1.18] Textures smaller than 16x16 cannot be used in resource packs, modded or otherwise #8094

Closed
shittothecore opened this issue Sep 19, 2021 · 6 comments · Fixed by #8622
Labels
1.18 Bug This request reports or fixes a new or existing bug. Confirmed This request has been verified to be factually correct by at least one member of the team. Rendering This request deals with rendering. These must be treated with care, and tend to progress slowly.

Comments

@shittothecore
Copy link

Minecraft Version: {1.17.1}

Forge Version: {37.0.61}

Logs: {latest.log}

Steps to Reproduce:

  1. Place resource pack archive in to .minecraft/resourcepacks/
  2. Launch minecraft and load resourcepack from main menu or in game pause menu
  3. Load in to world/unpause to get a better look

Description of issue:
GUI textures load but in game textures do not work, purple and black missing textures display on blocks etc, the resourcepacks I tried worked in vanilla minecraft.

@shittothecore shittothecore added the Triage This request requires the active attention of the Triage Team. Requires labelling or reviews. label Sep 19, 2021
@diesieben07
Copy link
Contributor

Does this happen with any resource pack?

@shittothecore
Copy link
Author

@diesieben07 I only tried two but it happened with both of them, Pollachius and simply8x8 if there's one you want me to try lmk

@AterAnimAvis
Copy link
Contributor

Effects any textures smaller than 16 pixels.

Replicatable with the attached resource pack for minecraft:stone Forge8094.zip
Pack format is 6 so the pack is loadable on 1.16.5 and 1.17.1 (if with a warning on 1.17.1).

Resulting in this non-fatal stacktrace

Description:

Forge patches Texture Atlas to not reduce the MipMap level #3087
Following down the call chain, MipmapGenerator#generateMipLevels then performs mipmap level number of >> 1 on the width / height in a loop as it generates the Mipmap textures.
This calls NativeImage#<init> which checks to ensure that width and height are both bigger than 0.
In the case that the original texture is smaller than 16 pixels in width / height and the mipmap level is at 4 (The default), the loop ends up trying to create a NativeImage with width / height of 0 (1 >> 1) which then throws, resulting in the missing texture.

In 1.16 NativeImage didn't perform these validations checks and as such didn't throw, allowing the generation to complete if even if the lower Mipmap Level Textures where invalid/corrupt.
Note that NativeImage's methods overall do more validation for out of bounds positions, etc.

@AterAnimAvis AterAnimAvis added 1.17 Bug This request reports or fixes a new or existing bug. Confirmed This request has been verified to be factually correct by at least one member of the team. and removed Triage This request requires the active attention of the Triage Team. Requires labelling or reviews. labels Sep 22, 2021
@Mapleshade20
Copy link

Mapleshade20 commented Oct 28, 2021

The same issue
image
A resource pack was successfully loaded with my original client. However, when i download it from my server which is set up with the mod 'ServerPropertiesLAN" 1.17.1, it appeared to be wrong, and the resources are missing, failed to load.

@Mapleshade20
Copy link

P.S. you can find the resource pack at https://gitee.com/zhangchenhao15/lol/raw/master/Tank.zip

@TheCurle TheCurle changed the title resourcepacks don't display in game model textures with forge [1.17, 1.18] Textures smaller than 16x16 cannot be used in resource packs, modded or otherwise Apr 22, 2022
@sciwhiz12 sciwhiz12 added the Rendering This request deals with rendering. These must be treated with care, and tend to progress slowly. label Apr 22, 2022
@sciwhiz12 sciwhiz12 added 1.18 and removed 1.17 labels Apr 29, 2022
@diesieben07
Copy link
Contributor

This happened in the 1.13.x update when this patch was missed.
The relevant code is now MipmapGenerator#generateMipLevels. The code will attempt to generate 0-sized NativeImage instances, which then throws.

This just came up again on the forums (https://forums.minecraftforge.net/topic/111211-1182-4010-empty-mods-folder-8x-and-below-resource-packs-failing/).

The problem is that just not lowering the mipmap level is also not ideal, because for textures this small it will look bad. I don't how to fix this, as I know too little about the mipmapping process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.18 Bug This request reports or fixes a new or existing bug. Confirmed This request has been verified to be factually correct by at least one member of the team. Rendering This request deals with rendering. These must be treated with care, and tend to progress slowly.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants