Jump to content

BROKEN [0.90] TextureReplacer 2.1.2 (20.12.2014)


shaw

Recommended Posts


The second thing is that I've opened some of your problematic images in Gimp and saved them as a TGA again (with RLE!). And they started working. Which application did you use to convert them?

Thanks, I'll definitely check out the new update when I'm home from work.

Images were converted with GraphicConverter; basically it's to OS X what InfranView is to Windows. I've used it before to batch convert png to TGA for KSP and haven't had any problems. I might just break down and shell script the renaming and conversion process.

Link to comment
Share on other sites

It doesn't matter whether a TGA is compressed or not. In RAM it occupies the same space. The reason is that GPUs only understand uncompressed textures and that compressed with DXT1, DXT3, DXT5 etc. So, all PNG, TGA, JPEG etc. textures exist in RAM either uncompressed or get converted to DXTn. TextureReplacer and TextureCompressor (aka Active Memory Reduction Mod) look for uncompressed textures in RAM (only those loaded from GameData/ dir) and compress them to DXT1 or DXT5 when possible.

Thanks for the clarification. Forgive my ignorance, but does TextureCompressor do its bit before the textures are initially loaded when the game's started? That's the period I'm looking to lessen, I've never had an issue with slow-loading textures once in the game. And if not, then is it possible to get the mod to also look for compressed textures, and still load them as if TextureCompressor already did its job?

If it's just a matter of GPUs not recognizing compressed TGAs full stop then dang, guess I gotta find a nice 2K pack. I ain't down for no 5 minute initial load.

edit: And I'm using Photoshop to convert PNGs to compressed TGA, if that matters.

Link to comment
Share on other sites

Been working on converting the Celestial Bodies Revamped texture pack to TGA. I think I did it properly, but for whatever reason I still get the same 'blips' on Kerbin when I'm looking at it from far away as I do with the normal PNGs. Kerbin has also turned grey for some reason even though I'm pretty sure I converted it to RGB-A, but I'll have to experiment with that some more.

EDIT: Gonna do more testing without the city lights & clouds mod since maybe that's the one at fault.

Edited by FenrirWolf
Link to comment
Share on other sites

It does the weird 90 degrees to the sun thing.

Kerbin's normal map.

I don't know what "weird 90°" thing means. Normal maps currently only work if you replace the main texture as well.

Link to comment
Share on other sites

Thanks for the clarification. Forgive my ignorance, but does TextureCompressor do its bit before the textures are initially loaded when the game's started? That's the period I'm looking to lessen, I've never had an issue with slow-loading textures once in the game. And if not, then is it possible to get the mod to also look for compressed textures, and still load them as if TextureCompressor already did its job?

If it's just a matter of GPUs not recognizing compressed TGAs full stop then dang, guess I gotta find a nice 2K pack. I ain't down for no 5 minute initial load.

edit: And I'm using Photoshop to convert PNGs to compressed TGA, if that matters.

AFAIK all textures, models and sounds are loaded in RAM during game database loading stage. That is before main menu, when KSP is loading. Both TextureReplacer and TextureCompressor perform texture compression on each engine update cycle during loading of the game database. On each update cycle KSP usually loads 1 or 2 textures, then TextureReplacer or TextureCompressor checks for newly loaded textures and compresses them to DXTn if possible.

After the game database is loaded (i.e. just before the main menu appears) TextureReplacer initialises replacement table. It maps all textures in GameData/TextureReplacer/Textures, no matter whether they are compressed or not.

And again it doesn't matter if a TGA is compressed. KSP uncompresses it during loading. GPU never gets a TGA/PNG/JPEG/GIF/BMP or whatever. It only get either (uncompressed) raw image data or DXTn-compressed raw image data. That's all CPUs understand.

Link to comment
Share on other sites

Been working on converting the Celestial Bodies Revamped texture pack to TGA. I think I did it properly, but for whatever reason I still get the same 'blips' on Kerbin when I'm looking at it from far away as I do with the normal PNGs. Kerbin has also turned grey for some reason even though I'm pretty sure I converted it to RGB-A, but I'll have to experiment with that some more.

EDIT: Gonna do more testing without the city lights & clouds mod since maybe that's the one at fault.

Is it the same with Universe Replacer? It applies some additional filtering to planet textures.

Link to comment
Share on other sites

AFAIK all textures, models and sounds are loaded in RAM during game database loading stage. That is before main menu, when KSP is loading. Both TextureReplacer and TextureCompressor perform texture compression on each engine update cycle during loading of the game database. On each update cycle KSP usually loads 1 or 2 textures, then TextureReplacer or TextureCompressor checks for newly loaded textures and compresses them to DXTn if possible.

After the game database is loaded (i.e. just before the main menu appears) TextureReplacer initialises replacement table. It maps all textures in GameData/TextureReplacer/Textures, no matter whether they are compressed or not.

And again it doesn't matter if a TGA is compressed. KSP uncompresses it during loading. GPU never gets a TGA/PNG/JPEG/GIF/BMP or whatever. It only get either (uncompressed) raw image data or DXTn-compressed raw image data. That's all CPUs understand.

All right then. So do you have any idea why a 16-bit TGA (compressed or not) doesn't seem to load, but 24-bit/32-bit compressed or otherwise load fine?

edit: Hm, apparently TGAs below 24 bit store their colour values differently, which may be the issue,

The bitsperpixel specifies the size of each colour value. When 24 or 32 the normal conventions apply. For 16 bits each colour component is stored as 5 bits and the remaining bit is a binary alpha value. The colour components are converted into single byte components by simply shifting each component up by 3 bits (multiply by 8).
Image type 1 and 9: Depending on the Pixel Depth value, image data representation is an 8, 15, or 16 bit index into a color map that defines the color of the pixel. Image type 2 and 10: The image data is a direct representation of the pixel color. For a Pixel Depth of 15 and 16 bit, each pixel is stored with 5 bits per color. If the pixel depth is 16 bits, the topmost bit is reserved for transparency. For a pixel depth of 24 bits, each pixel is stored with 8 bits per color. A 32 bit pixel depth defines an additional 8 bit alpha channel. Image type 3 and 11: The image data is a direct representation of grayscale data. The pixel depth is 8 bits for images of this type.
Edited by Franklin
Link to comment
Share on other sites

I don't know what "weird 90°" thing means. Normal maps currently only work if you replace the main texture as well.

Sorry for not being clear enough, my bad.

Here's some pictures: http://imgur.com/NPfE6H1,KVq4GFw,oeM7sXw,CXs5oG7#0

I've tried png, jpeg, and TGA. All do the same thing.

Edited by Thesonicgalaxy
Link to comment
Share on other sites

Sorry for not being clear enough, my bad.

Here's some pictures: http://imgur.com/NPfE6H1,KVq4GFw,oeM7sXw,CXs5oG7#0

I've tried png, jpeg, and TGA. All do the same thing.

Could you try if it works fine with Universe Replacer? If it does i think I know what's wrong.

And which texture pack do you use on that picture? I need to reproduce that issue in order to fix it.

Link to comment
Share on other sites

I threw together a quick and dirty shell script to convert textures from mixed image formats with Universe Replacer's naming over to RLE'd TGAs in TextureReplacer's naming. You'll need to have ImageMagick installed. There's no error checking and the source files need to live in the same directory as the script. Like I said, quick and dirty.

OS X users you need to jump through a couple hoops. First follow the install instructions at MacPorts to get Xcode and MacPorts installed. Then type, "sudo port install ImageMagick" in the terminal to install ImageMagick. Now navigate to the folder containing the script in the terminal, "cd /thePath/toThe/Folder/". Finally type, "chmod +x TextureConvert.sh" to make the script executable and use "./TextureConvert.sh" to run it. (If people have problems with this, I might just make a native droplet that uses sips to convert the images.)

ImageMagick and similar are available on Windows, but I don't know the first thing about batch files. It would be great if someone wanted to get this running on Windows.


#!/bin/bash

# creating an output directory just to keep things clean
mkdir ./00out/

#CelestialBodies
convert Skybox_NegativeX\.* -compress RLE ./00out/GalaxyTex_NegativeX.tga
convert Skybox_NegativeY\.* -compress RLE ./00out/GalaxyTex_NegativeY.tga
convert Skybox_NegativeZ\.* -compress RLE ./00out/GalaxyTex_NegativeZ.tga
convert Skybox_PositiveX\.* -compress RLE ./00out/GalaxyTex_PositiveX.tga
convert Skybox_PositiveY\.* -compress RLE ./00out/GalaxyTex_PositiveY.tga
convert Skybox_PositiveZ\.* -compress RLE ./00out/GalaxyTex_PositiveZ.tga

convert Sun_Corona\.* -compress RLE ./00out/suncoronanew.tga

convert Moho1\.* -compress RLE ./00out/moho00.tga
convert Moho2\.* -compress RLE ./00out/moho01.tga

convert Eve1\.* -compress RLE ./00out/Eve2_00.tga
convert Eve2\.* -compress RLE ./00out/Eve2_01.tga

convert Gilly1\.* -compress RLE ./00out/evemoon100.tga
convert Gilly2\.* -compress RLE ./00out/evemoon101.tga

convert Kerbin1\.* -compress RLE ./00out/KerbinScaledSpace300.tga
convert Kerbin2\.* -compress RLE ./00out/KerbinScaledSpace401.tga

convert Mun1\.* -compress RLE ./00out/NewMunSurfaceMapDiffuse.tga
convert Mun2\.* -compress RLE ./00out/NewMunSurfaceMapNormals.tga

convert Minmus1\.* -compress RLE ./00out/NewMunSurfaceMap00.tga
convert Minmus2\.* -compress RLE ./00out/NewMunSurfaceMap01.tga

convert Duna1\.* -compress RLE ./00out/Duna5_00.tga
convert Duna2\.* -compress RLE ./00out/Duna5_01.tga

convert Ike1\.* -compress RLE ./00out/desertplanetmoon00.tga
convert Ike2\.* -compress RLE ./00out/desertplanetmoon01.tga

convert Dres1\.* -compress RLE ./00out/dwarfplanet100.tga
convert Dres2\.* -compress RLE ./00out/dwarfplanet101.tga

convert Jool1\.* -compress RLE ./00out/gas1_clouds.tga
convert Jool2\.* -compress RLE ./00out/cloud_normal.tga

convert Laythe1\.* -compress RLE ./00out/newoceanmoon00.tga
convert Laythe2\.* -compress RLE ./00out/newoceanmoon01.tga

convert Vall1\.* -compress RLE ./00out/gp1icemoon00.tga
convert Vall2\.* -compress RLE ./00out/gp1icemoon01.tga

convert Tylo1\.* -compress RLE ./00out/rockymoon100.tga
convert Tylo2\.* -compress RLE ./00out/rockymoon101.tga

convert Bop1\.* -compress RLE ./00out/gp1minormoon100.tga
convert Bop2\.* -compress RLE ./00out/gp1minormoon101.tga

convert Pol1\.* -compress RLE ./00out/gp1minormoon200.tga
convert Pol2\.* -compress RLE ./00out/gp1minormoon201.tga

convert Eeloo1\.* -compress RLE ./00out/snowydwarfplanet00.tga
convert Eeloo2\.* -compress RLE ./00out/snowydwarfplanet01.tga

# Kerbals
convert EVAJetpack\.* -compress RLE ./00out/EVAjetpack.tga
convert EVAJetpackNormalMap\.* -compress RLE ./00out/EVAjetpackNRM.tga

convert EVAHelmet1\.* -compress RLE ./00out/EVAhelmet.tga
convert EVASuit1\.* -compress RLE ./00out/EVAtexture.tga
convert EVASuitNormalMap\.* -compress RLE ./00out/EVAtextureNRM.tga

convert IVAHelmet\.* -compress RLE ./00out/kerbalHelmetGrey.tga
convert IVASuitStandard\.* -compress RLE ./00out/kerbalMainGrey.tga
convert IVASuitVeteran\.* -compress RLE ./00out/kerbalMain.tga
convert IVASuitNormalMap\.* -compress RLE ./00out/kerbalMainNRM.tga

convert HelmetNormalMap\.* -compress RLE ./00out/kerbalHelmetNRM.tga

convert ArmsAndHands\.* -compress RLE ./00out/kerbal_armHands.tga
convert Head1\.* -compress RLE ./00out/kerbalHead.tga

Edited by somnambulist
Link to comment
Share on other sites

Could you try if it works fine with Universe Replacer? If it does i think I know what's wrong.

And which texture pack do you use on that picture? I need to reproduce that issue in order to fix it.

Nope, doesn't work on UR.

http://earthobservatory.nasa.gov/blogs/elegantfigures/files/2011/10/land_shallow_topo_2011_8192.jpg

http://www.supinemusic.net/Files%20for%20Cloud%20projects/Cinema%204D/plugins/Planet%20X%20Generator%20R12/presets/earth/Earth_Normal.png

Link to comment
Share on other sites

@Daze: You have two endings on images, like "GalaxyTex_NegativeX.tga.tga" (or something like that, I don't see what the second ending actually is). Turn on the option to show file endings in windows explorer.

Link to comment
Share on other sites

@somnambulist: "-compress RLE" has no effect. ImageMagick doesn't implement RLE compression (only de-compression). And what's the point of "\."? You could just write ".", it's bash not regular expression.

Link to comment
Share on other sites

@Thesonicgalaxy: AFAIK normal maps work in a different way in KSP. Normally RGB components represent X, Y, Z of normal vectors (as in your normal map). However, if you normal maps for KSP (e.g. for Kerbal spacesuits) they half-transparent grey images. They express normals (or height?) in varying brightness and transparency. I don't know how they actually work, you should do some research on Wiki and forum and convert your normal map accordingly.

Link to comment
Share on other sites

@Daze: You have two endings on images, like "GalaxyTex_NegativeX.tga.tga" (or something like that, I don't see what the second ending actually is). Turn on the option to show file endings in windows explorer.

Finally it works!!!

Thank you for your help :)

Link to comment
Share on other sites

@Thesonicgalaxy: AFAIK normal maps work in a different way in KSP. Normally RGB components represent X, Y, Z of normal vectors (as in your normal map). However, if you normal maps for KSP (e.g. for Kerbal spacesuits) they half-transparent grey images. They express normals (or height?) in varying brightness and transparency. I don't know how they actually work, you should do some research on Wiki and forum and convert your normal map accordingly.

Oh, okay! Thanks alot man :D

g9aIT7X.png

Now i can make real solar system mod even prettier!

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...