Bug:Spring incorrectly loads textures that are wider than 2k

Bug:Spring incorrectly loads textures that are wider than 2k

Share and discuss visual creations and creation practices like texturing, modelling and musing on the meaning of life.

Moderators: MR.D, Moderators

Post Reply
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Bug:Spring incorrectly loads textures that are wider than 2k

Post 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:
Image

4k W x 2k H:
Image

2k W x 4k H:
Image

1k W x 4k H:
Image

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:
Image

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.
Attachments
baduv.PNG
(537.83 KiB) Downloaded 2 times
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: Bug:Spring incorrectly loads textures that are wider than 2k

Post by Kloot »

Try a format other than tga, it's probably a bug in libIL (seen before).
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: Bug:Spring incorrectly loads textures that are wider than 2k

Post by FLOZi »

Fwiw S44 has some dds over this size and I don't recall ever seeing any issues.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Bug:Spring incorrectly loads textures that are wider than 2k

Post 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?
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: Bug:Spring incorrectly loads textures that are wider than 2k

Post 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)
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Bug:Spring incorrectly loads textures that are wider than 2k

Post 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.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: Bug:Spring incorrectly loads textures that are wider than 2k

Post 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)
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Bug:Spring incorrectly loads textures that are wider than 2k

Post 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.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Bug:Spring incorrectly loads textures that are wider than 2k

Post by Beherith »

My Photoshop cant save alpha channels in png :(
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Bug:Spring incorrectly loads textures that are wider than 2k

Post by Beherith »

Kloot wrote: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)
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.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: Bug:Spring incorrectly loads textures that are wider than 2k

Post 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.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Bug:Spring incorrectly loads textures that are wider than 2k

Post by Beherith »

My DevIL.dll and ILU.dll and ILUT.dll are all version 1.6.6 in my spring install (vanilla install)

Image


Updating to 1.7.8 http://sourceforge.net/projects/openil/ ... p/download

Fixes the problem:

Image

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!
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Bug:Spring incorrectly loads textures that are wider than 2k

Post by abma »

next release will contain the current devil dlls.
Post Reply

Return to “Art & Modelling”