I found a bug where if the input texture's height (y) is a multiple of 256 (ex.: 256x256), the model completely fails to render in-game.
Estimated Cause:
In objmc.py, the texture size is encoded into the second pixel of the header:
out.putpixel((1, 0), (int(x / 256), x % 256, int(y / 256), y % 256))
When y is a multiple of 256 (like 256, 512, etc.), the alpha channel (y % 256) evaluates to 0.
(According to an Gemini, it says: Because Minecraft's texture engine optimizes fully transparent pixels by discarding their RGB data, the shader ends up reading this pixel as (0, 0, 0, 0). This causes the shader to interpret the texture size as 0x0, breaking the rendering entirely.)
Workaround:
Resizing the texture height to something like 255 (ex. 256x255) prevents the alpha from becoming 0 and works perfectly.
*The same issue might also happen with nvertices if it hits a multiple of 256 and the alpha becomes 0.
(keyword for searching: model invisible, transparent)
I found a bug where if the input texture's height (
y) is a multiple of 256 (ex.: 256x256), the model completely fails to render in-game.Estimated Cause:
In
objmc.py, the texture size is encoded into the second pixel of the header:When
yis a multiple of 256 (like 256, 512, etc.), the alpha channel (y % 256) evaluates to 0.(According to an Gemini, it says: Because Minecraft's texture engine optimizes fully transparent pixels by discarding their RGB data, the shader ends up reading this pixel as (0, 0, 0, 0). This causes the shader to interpret the texture size as 0x0, breaking the rendering entirely.)
Workaround:
Resizing the texture height to something like 255 (ex. 256x255) prevents the alpha from becoming 0 and works perfectly.
*The same issue might also happen with
nverticesif it hits a multiple of 256 and the alpha becomes 0.(keyword for searching: model invisible, transparent)