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
Moderator
Posts: 4934
Joined: 26 Oct 2007, 16:21

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

Post by Beherith » 16 Feb 2012, 12:14

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
0 x

Kloot
Spring Developer
Posts: 1865
Joined: 08 Oct 2006, 16:58

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

Post by Kloot » 16 Feb 2012, 18:57

Try a format other than tga, it's probably a bug in libIL (seen before).
0 x

User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6109
Joined: 29 Apr 2005, 01:14

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

Post by FLOZi » 16 Feb 2012, 18:58

Fwiw S44 has some dds over this size and I don't recall ever seeing any issues.
0 x

User avatar
Beherith
Moderator
Posts: 4934
Joined: 26 Oct 2007, 16:21

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

Post by Beherith » 16 Feb 2012, 19:01

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?
0 x

Kloot
Spring Developer
Posts: 1865
Joined: 08 Oct 2006, 16:58

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

Post by Kloot » 16 Feb 2012, 22:19

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)
0 x

User avatar
Beherith
Moderator
Posts: 4934
Joined: 26 Oct 2007, 16:21

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

Post by Beherith » 16 Feb 2012, 22:26

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.
0 x

Kloot
Spring Developer
Posts: 1865
Joined: 08 Oct 2006, 16:58

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

Post by Kloot » 16 Feb 2012, 22:32

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)
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14606
Joined: 17 Nov 2005, 02:43

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

Post by Forboding Angel » 16 Feb 2012, 22:44

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.
0 x

User avatar
Beherith
Moderator
Posts: 4934
Joined: 26 Oct 2007, 16:21

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

Post by Beherith » 16 Feb 2012, 23:18

My Photoshop cant save alpha channels in png :(
0 x

User avatar
Beherith
Moderator
Posts: 4934
Joined: 26 Oct 2007, 16:21

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

Post by Beherith » 16 Feb 2012, 23:21

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.
0 x

Kloot
Spring Developer
Posts: 1865
Joined: 08 Oct 2006, 16:58

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

Post by Kloot » 17 Feb 2012, 03:30

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.
0 x

User avatar
Beherith
Moderator
Posts: 4934
Joined: 26 Oct 2007, 16:21

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

Post by Beherith » 17 Feb 2012, 09:28

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!
0 x

abma
Spring Developer
Posts: 3560
Joined: 01 Jun 2009, 00:08

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

Post by abma » 25 Feb 2012, 16:37

next release will contain the current devil dlls.
0 x

Post Reply

Return to “Art & Modelling”