Page 1 of 118 1231151101 ... LastLast
Results 1 to 10 of 1179

Thread: [0.24] TextureReplacer 1.6.1 (18.7.2014) -- Fixed for 0.24

  1. #1
    Sr. Spacecraft Engineer shaw's Avatar
    Join Date
    May 2013
    Location
    Slovenia
    Posts
    340

    [0.24] TextureReplacer 1.6.1 (18.7.2014) -- Fixed for 0.24



    TextureReplacer 1.6.1
    Kerbal pimping and texture replacement, compression, mipmap generation and trilinear filtering.

    TextureReplacer is a plugin for Kerbal Space Program that allows you to replace stock textures and customise your Kerbals. Originally, it was created as an alternative to Universe Replacer, which significantly lowers frame rate and causes lags on vehicle switching. TextureReplacer has no such issues plus it has many other cool features. More specifically, it can:
    • replace stock textures with custom ones,
    • set personalised head and suit textures for selected Kerbals,
    • set persistent random head and suit textures for other Kerbals,
    • remove IVA helmets in safe situations,
    • spawn Kerbals in IVA suit without helmet and jetpack in breathable atmosphere,
    • add normal map for head texture,
    • add helmet visor texture,
    • enable (fake) visor reflections,
    • generate missing mipmaps for PNG and JPEG model textures (to fix a KSP bug),
    • compress uncompressed textures from `GameData/` and reduce RAM usage and
    • change bilinear texture filter to trilinear to improve mipmap quality.

    Special thanks to:
    • rbray89 who contributed a reflective visor shader and for TextureCompressor (a.k.a. Active Texture Management) and Visual Enhancements where some code has been borrowed from,
    • Tingle for Universe Replacer; studying his code helped me a lot while developing this plugin,
    • Razchek and Starwaster for Reflection Plugin where I learnt how to implement reflections,
    • therealcrow999 for testing and benchmarking this plugin,
    • Proot, Green Skull and others for making texture packs for this plugin and
    • Sylith and scart91 for giving others permissions to make derivatives of their texture packs.

    Links

    When upgrading from 1.5.0 or 1.5.1: Delete `GameData/BoulderCo/ActiveTextureManagerConfigs/TextureReplacer.(t)cfg`, it contains invalid settings causing improper loading of normal maps when using ATM.

    Texture Packs



    Instructions
    There are also "idiot-proof" instructions from Green Skull's packs if you find the official TextureReplacer instructions too complicated.

    General Textures
    General replacement texture is of the form
    Code:
        GameData/TextureReplacer/Default/<internalName>
    where `<internalName>` is the texture's internal name in KSP or path of a texture inside `GameData/` (plus .png/.jpg/.tga/.mbm extension, of course).

    Examples:
    Code:
        GameData/TextureReplacer/
          Default/kerbalHead              // Default Kerbal head
          Default/kerbalMain              // Default IVA suit (veteran/orange)
          Default/kerbalMainGrey          // Default IVA suit (standard/grey)
          Default/kerbalMainNRM           // Default IVA suit normal map
          Default/kerbalHelmetGrey        // Default IVA helmet
          Default/kerbalHelmetNRM         // Default IVA & EVA helmet normal map
          Default/kerbalVisor             // Default IVA helmet visor
          Default/EVAtexture              // Default EVA suit
          Default/EVAtextureNRM           // Default EVA suit normal map
          Default/EVAhelmet               // Default EVA helmet
          Default/EVAvisor                // Default EVA helmet visor
          Default/EVAjetpack              // Default EVA jetpack
          Default/EVAjetpackNRM           // Default EVA jetpack normal map
    
          Default/GalaxyTex_PositiveX     // skybox right face
          Default/GalaxyTex_NegativeX     // skybox left face
          Default/GalaxyTex_PositiveY     // skybox bottom face, rotated for 180°
          Default/GalaxyTex_NegativeY     // skybox top face
          Default/GalaxyTex_PositiveZ     // skybox front face
          Default/GalaxyTex_NegativeZ     // skybox back face
    
          Default/moho00                  // Moho
          Default/moho01                  // Moho normal map
          Default/Eve2_00                 // Eve
          Default/Eve2_01                 // Eve normal map
          Default/evemoon100              // Gilly
          Default/evemoon101              // Gilly normal map
          Default/KerbinScaledSpace300    // Kerbin
          Default/KerbinScaledSpace401    // Kerbin normal map
          Default/NewMunSurfaceMapDiffuse // Mün
          Default/NewMunSurfaceMapNormals // Mün normal map
          Default/NewMunSurfaceMap00      // Minmus
          Default/NewMunSurfaceMap01      // Minmus normal map
          Default/Duna5_00                // Duna
          Default/Duna5_01                // Duna normal map
          Default/desertplanetmoon00      // Ike
          Default/desertplanetmoon01      // Ike normal map
          Default/dwarfplanet100          // Dres
          Default/dwarfplanet101          // Dres normal map
          Default/gas1_clouds             // Jool
          Default/cloud_normal            // Jool normal map
          Default/newoceanmoon00          // Laythe
          Default/newoceanmoon01          // Laythe normal map
          Default/gp1icemoon00            // Vall
          Default/gp1icemoon01            // Vall normal map
          Default/rockyMoon00             // Tylo
          Default/rockyMoon01             // Tylo normal map
          Default/gp1minormoon100         // Bop
          Default/gp1minormoon101         // Bop normal map
          Default/gp1minormoon200         // Pol
          Default/gp1minormoon201         // Pol normal map
          Default/snowydwarfplanet00      // Eeloo
          Default/snowydwarfplanet01      // Eeloo normal map
    It's also possible to replace textures from `GameData/` if one specifies the full directory hierarchy:
    Code:
        GameData/TextureReplacer/
          Default/Squad/Parts/Command/Mk1-2Pod/model000  // Mk1-2 pod texture
          Default/Squad/Parts/Command/Mk1-2Pod/model001  // Mk1-2 pod normal map
    Note that all texture and directory names are case-sensitive!

    Visor Reflections
    Environment map cube texture for visor reflections is included with the plugin:
    Code:
        GameData/TextureReplacer/
          EnvMap/PositiveX  // fake skybox right face, vertically flipped
          EnvMap/NegativeX  // fake skybox left face, vertically flipped
          EnvMap/PositiveY  // fake skybox top face, vertically flipped
          EnvMap/NegativeY  // fake skybox bottom face, vertically flipped
          EnvMap/PositiveZ  // fake skybox front face, vertically flipped
          EnvMap/NegativeZ  // fake skybox back face, vertically flipped
    Note that all textures must be squares and have the same dimensions that are powers of two. Cube textures are slow, so keep them as low-res as possible.

    Personalised Kerbal Textures
    Heads and suits are assigned either manually (custom Kerbals) or pseudo-randomly (generic Kerbals). Pseudo-random assignment is based on a Kerbal's name, which ensures the same head/suit is always assigned to a given Kerbal.

    Head textures reside in `Heads/` directory and have arbitrary names. Normal maps are optional. To provide a normal map, name it the same as the head texture but add "NRM" suffix.
    Code:
        GameData/TextureReplacer/
          Heads/<head>      // Head texture
          Heads/<head>NRM   // Normal map for head texture <head> (optional)
    Suit textures' names are identical as for the default texture replacement except that there is no `kerbalMain` texture (`kerbalMainGrey` replaces both). Each suit must reside in its own directory:
    Code:
        GameData/TextureReplacer/
          Suits/<suit>/kerbalMainGrey   // IVA suit
          Suits/<suit>/kerbalMainNRM    // IVA suit normal map
          Suits/<suit>/kerbalHelmetGrey // IVA helmet
          Suits/<suit>/kerbalHelmetNRM  // IVA & EVA helmet normal map
          Suits/<suit>/kerbalVisor      // IVA helmet visor
          Suits/<suit>/EVAtexture       // EVA suit
          Suits/<suit>/EVAtextureNRM    // EVA suit normal map
          Suits/<suit>/EVAhelmet        // EVA helmet
          Suits/<suit>/EVAvisor         // EVA helmet visor
          Suits/<suit>/EVAjetpack       // EVA jetpack
          Suits/<suit>/EVAjetpackNRM    // EVA jetpack normal map
    For generic Kerbals, heads are selected independently form suits so any head can be paired with any of the suits and each head has an equal chance of being selected.

    See configuration file contents for how to configure head/suit assignment rules.

    Configuration File
    Main configuration file:
    Code:
        GameData/TextureReplacer/@Default.cfg
    One can also use additional configuration files; configuration is merged from all `*.cfg` files that contain `TextureReplacer { ... }` as the root node. This should prove useful to developers of texture packs so they can distribute pack-specific head/suit assignment rules in a separate file. All the `*.cfg` files (including `@Default.cfg`) are processed in alphabetical order (the reason behind the leading "@" in the `@Default.cfg` is that it is processed first and is overridden by subsequent configuration files).

    Notes
    • Try to keep dimensions of all textures powers of two. Non-power-of-two textures are not handled well in some cases and cannot be compressed.
    • KSP can only load TGAs with RGB or RGBA colours. Paletteised 256-colour TGAs cause corruptions in the game database!
    • By default, texture compression is handled by ATM when present rather than by TextureReplacer.
    • KSP never generates mipmaps for PNGs and JPEGs. TextureReplacer fixes this by generating mipmaps under paths specified in the configuration file. Other images are omitted to avoid making UI icons of various plugins blurry when not using the full texture quality.
    • The planet textures being replaced are the high-altitude textures which are also used in the map mode and in the tracking station. When getting closer to the surface those textures are slowly interpolated into high-resolution ones that cannot be replaced by this plugin.

    Known Issues
    • If there is no IVA suit replacement the default EVA suit texture is used for the atmospheric EVAs. [Won't fix. Provide an IVA suit to fix it.]
    • If a Kerbal rides to space on a rover seat he/she ends up in orbit in his/her IVA suit without a helmet. [Won't fix, it's too complicated. Just reload the scene to repawn a Kerbal in his/her EVA suit.]
    • Replacement of textures from `GameData/` does not work for certain models. [No known fix.]
    • Jetpack flags re-appear after dismounting a KerbalQuest jetpack. [No fix.]



    Texture Format Guide (for developers)
    This guide only covers TGA, PNG and JPEG formats since MBMs are (almost) never used in texture packs and I don't know much about them.

    TGA (*.tga)
    • Vanilla (non-modded): not compressed; mipmaps
    • TextureReplacer: compressed (DXT1 or DXT5); mipmaps
    • Supports transparency.
    • No quality loss.
    • The fastest loading times (vanilla: no compression, TR: compressed once).
    • The largest size on disk.
    • Not suitable for UI icons since TGAs always have mipmaps.

    PNG (*.png)
    • Vanilla: compressed (DXT5); no mipmaps
    • TextureReplacer: compressed (DXT1 or DXT5); mipmaps if included in `generateMipmaps` (should cover (almost) all model textures), no mipmaps otherwise (UI icons).
    • Supports transparency.
    • No quality loss.
    • Slower loading times (vanilla: compressed once, TR: compressed twice).
    • Smaller than TGA on disk but usually larger than JPEG.
    • Not suitable for model textures without TextureReplacer or ATM installed since they lack mipmaps.

    JPEG (*.jpg)
    • Vanilla: compressed (DXT1); no mipmaps
    • TextureReplacer: compressed (DXT1); mipmaps if included in `generateMipmaps` (should cover (almost) all model textures), no mipmaps otherwise (UI icons).
    • No transparency.
    • Quality loss (depending on JPEG quality).
    • Slower loading times (vanilla: compressed once, TR: compressed twice).
    • Usually the smallest on disk.
    • Undesired for normal maps because of quality loss.
    • Not suitable for model textures without TextureReplacer or ATM installed since they lack mipmaps.

    Normal maps (*NRM.tga, *NRM.png, *NRM.jpg)
    • Vanilla: not compressed; no mipmaps
    • TextureReplacer: not compressed; no mipmaps. Normal maps are unloaded immediately, so TextureReplacer cannot manipulate them. However, ATM can do that.

    Clarifications
    • Texture compression reduces texture size to 1/6 (DXT1) or 1/4 (DXT5) in VRAM and also increases performance, since less data has to be transferred over the bus to the GPU. Because of quality loss, normal maps are often not compressed. Texture compression is a demanding process and drastically slows down texture loading.
    • When using 1/2, 1/4 etc. texture quality, mipmaps on all textures are shifted, so its 1st, 2nd etc. mipmap is used in place of the original texture. This works fine with models, but makes UI icons blurry. That's why UI images shouldn't have mipmaps.
    • TextureReplacer re-generates textures when building mipmaps. This means PNGs and JPEGs get compressed twice, first when Unity loads them and then when TextureReplacer rebuilds them with mipmaps. That's why TGAs are recommended for faster loading times.
    • During mipmap generation, TextureReplacer detects whether a texture has any transparent pixels, so DXT5-compressed PNGs may be re-compressed as DXT1.

    Recommended texture formats
    • Vanilla: TGAs for model textures, PNGs for normal maps, PNGs or JPEGs for UI images.
    • With TextureReplacer or ATM: Any format for model textures, PNGs for normals maps, PNGs or JPEGs for UI images.



    ChangeLog
    • 1.6.1
      - rebuilt for KSP 0.24
    • 1.6
      - changed the way how internal spaces are treated, it should now work fine with transparent pods using JSITransparentPod and sfr mods
      - helmets are also removed in pre-launch to handle rovers & stuff correctly
      - tab characters can be used as list separators in configuration files
    • 1.5.10
      - IVA helmets are removed is safe situations (landed/splashed, in orbit)
    • 1.5.2
      - improved options for configuring texture unloading
      - fixed spawning in IVA suit on Laythe and its orbit when leaving ext. seat
      - removed ATM configuration, normal maps cannot be configured correctly
    • 1.5.1
      - fixed unnecessary texture replacement passes on scene switches
      - fixed default config for Lazor System and KSI MFDs compatibility
    • 1.5
      - textures are now (mostly) unloaded from RAM just before the main menu
      - added configuration option to prevent textures from being unloaded
      - changed compression and mipmap generation logic
      - changed configuration file options for mipmap generation; RE supported
      - changed general texture replacement to time-based
      - reverted to the old way of removing (some) meshes to prevent helmets or eyes from re-appearing when using certain mods
      - added compatibility for ATM

    Full changelog

    Credits & Licence
    This plugin is distributed under the terms of MIT licence. The main author is shaw, while some parts (visor shader, texture compression and mipmap generation) are based on code contributed by rbray89. The included environment map textures are distributed under the CC BY-NC-SA 4.0 licence and are based on skybox from Pimp My Kerbals texture pack created by Proot.
    Last edited by shaw; 10th August 2014 at 22:19. Reason: updated texture packs

  2. #2
    Junior Rocket Scientist therealcrow999's Avatar
    Join Date
    Mar 2012
    Location
    Elmira, NY
    Posts
    618
    Awesome, the one reason I don't use UR is because I get frame rate drops. This one is gives me better rates then UR, but is still down. I lose half my frame rates. I could never understand why with either one of these plugins, they just replace textures. I get those drops even before I put textures in.

    I will definitely use this one, as it seems better and I am sure it will get better.

  3. #3
    UniverseReplacer is a great mod, but I always felt the performance impact was higher than it needed to be. Fortunately someone came to the same conclusion and wrote a plugin to mitigate the problem. Great!

  4. #4
    Junior Rocket Scientist therealcrow999's Avatar
    Join Date
    Mar 2012
    Location
    Elmira, NY
    Posts
    618
    Yeah it was really bad. I even use to post on the thread about it all the time. I figured no one was listening. I really wanted to use my Orange Kerbal Eva suits. If I knew how to code, I would of done it a long time ago. I'm glad to see this mod here.

    Quote Originally Posted by Camacha View Post
    UniverseReplacer is a great mod, but I always felt the performance impact was higher than it needed to be. Fortunately someone came to the same conclusion and wrote a plugin to mitigate the problem. Great!

  5. #5

  6. #6
    Sr. Spacecraft Engineer shaw's Avatar
    Join Date
    May 2013
    Location
    Slovenia
    Posts
    340
    @therealcrow999: High-res resolution textures also cause performance drop, since GPU has to fetch more data from memory on each frame and there is worse cache locality => more cache misses => more cycles spent waiting for data.

  7. #7
    Junior Rocket Scientist therealcrow999's Avatar
    Join Date
    Mar 2012
    Location
    Elmira, NY
    Posts
    618
    This was before I put any textures in with UR.

    Quote Originally Posted by shaw View Post
    @therealcrow999: High-res resolution textures also cause performance drop, since GPU has to fetch more data from memory on each frame and there is worse cache locality => more cache misses => more cycles spent waiting for data.

  8. #8
    Sr. Spacecraft Engineer shaw's Avatar
    Join Date
    May 2013
    Location
    Slovenia
    Posts
    340
    @therealcrow999: Could you try this if it helps: https://dl.dropboxusercontent.com/u/...reReplacer.dll?
    It only triggers TR every 8 frames. When having really lots of objects/parts on scene iterating though all the materials might be the bottleneck.

  9. #9
    Junior Rocket Scientist therealcrow999's Avatar
    Join Date
    Mar 2012
    Location
    Elmira, NY
    Posts
    618
    Removed this comment
    Last edited by therealcrow999; 11th December 2013 at 18:44.

  10. #10
    Junior Rocket Scientist therealcrow999's Avatar
    Join Date
    Mar 2012
    Location
    Elmira, NY
    Posts
    618
    I'll give it a go and fire it up.

    Quote Originally Posted by shaw View Post
    @therealcrow999: Could you try this if it helps: https://dl.dropboxusercontent.com/u/...reReplacer.dll?
    It only triggers TR every 8 frames. When having really lots of objects/parts on scene iterating though all the materials might be the bottleneck.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •