Opened 6 years ago
Last modified 6 years ago
#5172 new defect
Report unsupported textures (NPOT textures)
Reported by: | elexis | Owned by: | |
---|---|---|---|
Priority: | Should Have | Milestone: | Backlog |
Component: | Core engine | Keywords: | |
Cc: | Patch: |
Description (last modified by )
0 A.D. currnetly requires textures to be of the size 2^n * 2^n
(POT).
bubble.png
was a PNG image, sized 24px * 24px and caused a re-release of Alpha 23 as it crashed the packaged OSX version when entering the gamesetup from the lobby, but reportedly no other platforms, see #5164 / r21822 / Phab:D1498.
So either images of arbitrary resolutions should be supported or these files should be reported by some new script.
Notice that it affects mod developers equally.
(If I recall correctly, Vladislav mentioned that most code supports it already, but only mipmap code doesn't?)
POT - Power-Of-Two
NPOT - Non-Power-Of-Two
Change History (9)
comment:1 by , 6 years ago
Description: | modified (diff) |
---|
follow-up: 3 comment:2 by , 6 years ago
comment:3 by , 6 years ago
Replying to stanislas69:
According to Aeonios here: https://wildfiregames.com/forum/index.php?/topic/24372-script-to-find-non-power-of-two-textures/
NPOT doesn't work on ATI. Really it doesn't work well in general, and is not something we should encourage. Packing into an atlas does fix that though.
It depends on video card and driver versions, also compression presenting makes sense too.
(If I recall correctly, Vladislav mentioned that most code supports it already, but only mipmap code doesn't?)
It seems so, only mipmaps have such assert.
comment:4 by , 6 years ago
It depends on video card and driver versions, also compression presenting makes sense too.
Indeed, it does, that's I guess the reason why he said it didn't work on ATI cards specifically. But I don't know if it's still relevant today https://www.khronos.org/opengl/wiki/NPOT_Texture
I agree though that it's a bad idea to use NPOT textures. I haven't seen a single AAA game using something else.
follow-up: 7 comment:5 by , 6 years ago
Summary: | Support NPOT images (resolution other than 2^n * 2^n) or report unsupported files → Report unsupported textures (non-NPOT textures) |
---|
Also there are optimizations for NPOT textures if what I recall from what I heard once upon a time is correct.
comment:6 by , 6 years ago
Description: | modified (diff) |
---|---|
Summary: | Report unsupported textures (non-NPOT textures) → Report unsupported textures (NPOT textures) |
comment:7 by , 6 years ago
Replying to elexis:
Also there are optimizations for NPOT textures if what I recall from what I heard once upon a time is correct.
I suppose for POT textures.
comment:8 by , 6 years ago
Priority: | Nice to Have → Should Have |
---|
We really don't want to run into that issue again that we introduce a NPOT texture and only conditionally break only OSX without noticing.
So we either need a good test/reporter to prevent this rare callstack or a more failsafe error handling (such as returning an empty texture and doing a LOGERROR).
Calling CTexture::TryLoad
for the dds texture loads the function affected by the callstack. The POT test ceil_log2
from the decode_sd
function should be done for all platforms.
The test could be ran either in some test_TextureManager.cpp
when passing --test-texture
or within ArchiveBuilder.cpp
.
comment:9 by , 6 years ago
What about doing it when using the archive builder ?
Ah my bad just saw the last line of your post.
According to Aeonios here: https://wildfiregames.com/forum/index.php?/topic/24372-script-to-find-non-power-of-two-textures/