Page 1 of 1
Bug:Spring incorrectly loads textures that are wider than 2k
Posted: 16 Feb 2012, 12:14
by Beherith
It flips the first 1024 width of the texture vertically. The following cube has faces textured with a 1-2-3-...16 pattern:
4k W x 4k H:
4k W x 2k H:
2k W x 4k H:
1k W x 4k H:
I have previously run into this bug when mapping, as I couldnt make a splat distribution or a map normals texture be larger than 2k wide.
Also, the textures loaded by Lua (the 4k by 4k normal texture loaded by a lua shader) are loaded fully correctly!
Edit: changed topic to reflect findings:
I has a very large atlas (4k by 4k). And I have an .s3o using a small part of it:
I have been using this same atlas on multiple models, but for some reason spring has started to show them with corrupt UVs (kinda like when you forget to flip the uvs, but not that because I tried that too).
The model looks fine in upspring, only looks bad in spring.
Anyone run into anything similar?
Edit 2: I should rather just mantis this, only keeping the topic so others can maybe find it if they run into the bug.
Re: Bug:Spring incorrectly loads textures that are wider than 2k
Posted: 16 Feb 2012, 18:57
by Kloot
Try a format other than tga, it's probably a bug in libIL (
seen before).
Re: Bug:Spring incorrectly loads textures that are wider than 2k
Posted: 16 Feb 2012, 18:58
by FLOZi
Fwiw S44 has some dds over this size and I don't recall ever seeing any issues.
Re: Bug:Spring incorrectly loads textures that are wider than 2k
Posted: 16 Feb 2012, 19:01
by Beherith
I tried both tga and tif. Lua loads both correctly, spring engine screws up both.
I dont want DDS because I want lossless, I hate the way png mixes alpha and transparency. Spring doesnt load alpha for bmp. Whats left?
Re: Bug:Spring incorrectly loads textures that are wider than 2k
Posted: 16 Feb 2012, 22:19
by Kloot
You seem to have fucked up the texture coordinates in this case.
http://imageshack.us/photo/my-images/52 ... 00001k.png
(those are your own tga's on both the Lua-drawn quad and the model, unconverted and unresized)
Re: Bug:Spring incorrectly loads textures that are wider than 2k
Posted: 16 Feb 2012, 22:26
by Beherith
I did not, as the texcoords look fine in both upspring and wings3d.
Can this be a driver issue/library issue? 8800GT with newest drivers, and ive had this bug for ages (same as with splattex)
Hmm, could it be a bug in the shader framework im using, cant test cause gf is here, test in a few hours.
Re: Bug:Spring incorrectly loads textures that are wider than 2k
Posted: 16 Feb 2012, 22:32
by Kloot
http://imageshack.us/photo/my-images/84 ... 00000.png/
Look familiar?
(there are two ways to fix it: either flip the texture vertically or flip the coordinates vertically)
Re: Bug:Spring incorrectly loads textures that are wider than 2k
Posted: 16 Feb 2012, 22:44
by Forboding Angel
Don't use tga, use PNG or dds (png gets my vote). PNG is easy to manage.
As for your dislike of png, the most helpful advice I can give you is, get over it.
Re: Bug:Spring incorrectly loads textures that are wider than 2k
Posted: 16 Feb 2012, 23:18
by Beherith
My Photoshop cant save alpha channels in png

Re: Bug:Spring incorrectly loads textures that are wider than 2k
Posted: 16 Feb 2012, 23:21
by Beherith
That is not what I mean. Look at my first picture. The first column of numbers is upside down (sorry about the horrible hand drawn numbers). The 2-3-4th column is right side up.
Look at the third pic. that is a 2k wide texture, and the first 2 columns of numbers are inverted.
Re: Bug:Spring incorrectly loads textures that are wider than 2k
Posted: 17 Feb 2012, 03:30
by Kloot
Humor me, what's the effect if you do flip the textures or (preferably) the coordinates and disable the shader framework? In case my first screenshot didn't make it clear, there is definitely no engine bug corrupting them during loading (also confirmed for your tga's by inserting some code that saves each decompressed S3O texture back to a raw bitmap, they came out identical), so that leaves the image library version (which can be ruled out, Lua textures are also loaded through it) and drivers/rendering.
Re: Bug:Spring incorrectly loads textures that are wider than 2k
Posted: 17 Feb 2012, 09:28
by Beherith
My DevIL.dll and ILU.dll and ILUT.dll are all version 1.6.6 in my spring install (vanilla install)
Updating to 1.7.8
http://sourceforge.net/projects/openil/ ... p/download
Fixes the problem:
Cube is not lua shadered, building is. So it seems that just a dll update is needed for spring. Thanks for bearing with me, Kloot!
Re: Bug:Spring incorrectly loads textures that are wider than 2k
Posted: 25 Feb 2012, 16:37
by abma
next release will contain the current devil dlls.