Resizing (upscaling) textures

robbddnn

New Member
Joined
Mar 25, 2012
Messages
7
After reading this very interesting information about resizing images http://www.imagemagick.org/Usage/resize/, I got to wondering if there would be a benefit to increasing the size of textures in SWG.

Obviously the best option is to replace or remake the textures, but I don't have the skill or time for that. The next best option is to increase the size while minimising blur or other unwanted artifacts. Once the best configuration settings are found, the conversion process can be scripted.

I'm willing to spend a decent chunk of time doubling or quadrupling the size of various (all?) textures using various upscaling algorithms. But is it worth it? I understand I am not adding new information or greater definition.

I imagine one place where it would be worth it is where a small texture is stretched over a larger area. Using a larger texture would result in less stretching.

Are there any thoughts on this idea?

I have a question too, is there any documentation regarding what textures are used in different "biomes" or areas? I can get an idea from the filenames, but I'm sure somebody has spent time on this already.
 

Lasko

Moderator
Staff member
Moderator
Joined
Feb 13, 2012
Messages
295
I'm not the person to ask about resizing, but as to documentaion.....

SWG and documentation are two words not commonly found in the same sentence...... Unless followed by "lack of", although it is improving. But...

The easiest way to find what shaders go where, is to open a .trn file in SIE and look at the SGRP family, it's the first family group at the top.

It'll tell you what shaders are used on that particular planet. If you wanna look deeper, then look in the layer family and it'll tell you where.

I've never seen an actual list of what's where though.
 

robbddnn

New Member
Joined
Mar 25, 2012
Messages
7
Thanks Lasko that's very useful info.

I was a bit overwhelmed by how the textures are spread throughout the various .tre files and the task was starting to look more difficult than it ought to be. But now that I have a better idea of how textures are organised or referenced, I think I can make some good progress.

I'm not expecting great quality improvements, but at the very least we'll end up with a set (or sets) of (correctly) resized textures that an actual artist can work on/from. If it's not too tricky I'd like to make sets of textures like e.g Terrain, Housing etc.
 

robbddnn

New Member
Joined
Mar 25, 2012
Messages
7
Sorry guys I have nothing to show. Ultimately the payoff wasn't worth it. I couldn't tell a difference between the original and resized textures. And there was a whole lot more manual intervention than I had anticipated. I tried a few different approaches and all I could notice was increased GPU memory usage.

Creating sets of textures like e.g "Corellian ground textures" turned out to be very hands-on too. It's not a good use of time to identify and package all the related textures, because it's very unlikely I'll get it right first time and it will take several re-visits. And that time is better spent re-making textures.

It wasn't a total waste of time though. It's given me inspiration for another project. This time I'm going to use Substance Designer to re-make textures, using the originals as very close inspiration. I'll start with flat textures like ground and walls and when I get more familiar with models I can start on player and creature species.

I'll make a new post when I have something to show.
 

Timbab

Administrator
Staff member
Administrator
Moderator
Joined
Oct 6, 2010
Messages
1,057
Location
Magna Germania
Yeah, algorithm upscaling isn't generally worth it for having better looking game textures, if at all, you'd want to combine it with overpainting techniques that are done manually (Took a shot at Composite Armor in the past) or whatever else.

You tend to be able to find texture packs in other games that use upscale > sharpen filter, which some find nice, but I personally hate the look of those.

P.S. Easy/best way to have unique set of textures for each planet is to simply copy and rename them both as files and in the .TRN, as Lasko kind of alluded to.



So here for example, 'Child:shader' is pointing to the shader/*.sht name of the shader, which might or might not be used in multiple files in the game, so what you want to do is rename it in the .TRN, to, say rename grss_long_darkgreen to dantooine_grss_long_darkgreen in that .TRN (And the other children ofc, then;

Go and copy/grab/edit shader/grss_long_darkgreen.sht, rename it to dantooine_grss_long_darkgreen.sht and open it up, then edit the TXMS/TXM/000x/NAME chunk string in the same manner as you've renamed the .sht, then make a copy of that file and rename it so you now have a completely new file structure that is only used by that .TRN.



Yes, it'll take a little bit to set it all up, but ultimately it's worth it. Same method can also be applied to most things in the game, models, textures, audio files, object iff's even, etc.
 

robbddnn

New Member
Joined
Mar 25, 2012
Messages
7
Thanks for that info Timbab. I will try to make use of it after I get the proof of concept working.

I prefer the idea of not replacing the original textures because (with a few exceptions) they are very well made and have a consistent style that I am having a lot of trouble replicating with Substance Painter. It's possible but it's time-consuming like nothing else I've ever tried. And I'm no artist tbh.

So I went back to the upscaling idea. I knew it had merit, it was just a question of finding the right method. Check this out http://webdav.tuebingen.mpg.de/pixel/enhancenet/ Some much smarter people than me have trained a neural network to perform very high quality image upscaling. And they have made it publicly available. It basically upscales everything by 4x which is perfect for this application.

The upscaling method will produce differences between the regular and normal textures (because it synthesizes new information) and that will mess up the bump-mapping. To do it the right way, I would have to create new normals from the upscaled textures. All the normal filenames seem to end with "_n" so it might not be too tricky to identify them and there are tools to automatically create the new normals from the upscaled textures. There are some other textures like color-ramps that don't need to upscaled and I might be able to easily exclude those too.

But ... nothing is ever straightforward and I've spent all evening in Python hell. I'm going to try again tomorrow with FreeBSD instead of Ubuntu because I think Ubuntu has some weird relationship with Python that I don't understand.

The TL;DR is this :

Original http://webdav.tuebingen.mpg.de/pixel/enhancenet/files/eagle-nn.jpg
Upscaled http://webdav.tuebingen.mpg.de/pixel/enhancenet/files/eagle-pat.jpg
 
Top Bottom