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



All times are UTC + 1 hour


Post new topic Reply to topic  [ 13 posts ] 
Author Message
PostPosted: 16 Feb 2012, 12:14 
Moderator
User avatar

Joined: 26 Oct 2007, 15:21
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:
Quote:
I has a very large atlas (4k by 4k). And I have an .s3o using a small part of it:
[img]
Attachment:
baduv.PNG
[/img]

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
Top
 Offline Profile  
 
PostPosted: 16 Feb 2012, 18:57 
Spring Developer

Joined: 08 Oct 2006, 15:58
Try a format other than tga, it's probably a bug in libIL (seen before).


Top
 Offline Profile  
 
PostPosted: 16 Feb 2012, 18:58 
Moderator
User avatar

Joined: 29 Apr 2005, 00:14
Location: #moddev - join it!
Fwiw S44 has some dds over this size and I don't recall ever seeing any issues.


Top
 Offline Profile  
 
PostPosted: 16 Feb 2012, 19:01 
Moderator
User avatar

Joined: 26 Oct 2007, 15:21
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?


Top
 Offline Profile  
 
PostPosted: 16 Feb 2012, 22:19 
Spring Developer

Joined: 08 Oct 2006, 15:58
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)


Top
 Offline Profile  
 
PostPosted: 16 Feb 2012, 22:26 
Moderator
User avatar

Joined: 26 Oct 2007, 15:21
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.


Top
 Offline Profile  
 
PostPosted: 16 Feb 2012, 22:32 
Spring Developer

Joined: 08 Oct 2006, 15:58
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)


Top
 Offline Profile  
 
PostPosted: 16 Feb 2012, 22:44 
Evolution RTS Developer
User avatar

Joined: 17 Nov 2005, 02:43
Location: Raegquitting Spring on 04/24/12
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.


Top
 Offline Profile  
 
PostPosted: 16 Feb 2012, 23:18 
Moderator
User avatar

Joined: 26 Oct 2007, 15:21
My Photoshop cant save alpha channels in png :(


Top
 Offline Profile  
 
PostPosted: 16 Feb 2012, 23:21 
Moderator
User avatar

Joined: 26 Oct 2007, 15:21
Kloot wrote:
http://imageshack.us/photo/my-images/849/screen00000.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.


Top
 Offline Profile  
 
PostPosted: 17 Feb 2012, 03:30 
Spring Developer

Joined: 08 Oct 2006, 15:58
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.


Top
 Offline Profile  
 
PostPosted: 17 Feb 2012, 09:28 
Moderator
User avatar

Joined: 26 Oct 2007, 15:21
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/files/DevIL%20Win32/1.7.8/DevIL-EndUser-x86-1.7.8.zip/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!


Top
 Offline Profile  
 
PostPosted: 25 Feb 2012, 16:37 
Spring Developer

Joined: 31 May 2009, 23:08
next release will contain the current devil dlls.


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.