Page 1 of 151 1231151101 ... LastLast
Results 1 to 10 of 1502

Thread: [0.25] TextureReplacer 1.10.2 (22.11.2014) -- EVA suit toggle, optimisations

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

    [0.25] TextureReplacer 1.10.2 (22.11.2014) -- EVA suit toggle, optimisations



    TextureReplacer 1.10.2
    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,
    • set suits based on Kerbals' experiences,
    • set cockpit-specific IVA suits,
    • 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) reflections on helmet visors and parts,
    • generate missing mipmaps for PNG and JPEG model textures (to fix a KSP bug),
    • compress uncompressed textures from `GameData/` and reduce RAM usage,
    • change bilinear texture filter to trilinear to improve mipmap quality and
    • unload textures from RAM after KSP finishes loading.

    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,
    • taniwha for KerbalStats that is optionally used by this plugin for gender determination and role-based suit assignment,
    • Razchek and Starwaster for Reflection Plugin where I learnt how to implement reflections,
    • therealcrow999 for testing and benchmarking this plugin,
    • Ippo343 for contributing KSP-AVC configuration,
    • 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

    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/kerbalHeadNRM           // Default Kerbal head normal map
          Default/kerbalMainGrey          // Default IVA suit
          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/HUDNavBall              // HUD NavBall
          Default/IVANavBall              // IVA NavBall, horizontally flipped
    
          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!

    Reflections
    Reflections are shown on visors of Kerbal's helmets and on parts that include `TRReflection` module, e.g.:
    Code:
          MODULE
          {
            name = TRReflection
            colour = 0.5 0.5 0.5
            meshes = OuterShell FrontWindow SideWindow
          }
    `colour` ("0.5 0.5 0.5" by default) and `meshes` (empty by default) parameters are optional. Reflection texture is multiplied by `colour` and applied on the meshes from `meshes` list or on whole part if `meshes` is empty or missing.

    Environment cube map texture for 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 map 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. Additionally it is also possible to assign suits consecutively, based on rooster index, or based on Kerbal experience if KerbalStats plugin is present.

    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
    Code:
    // IF YOU ARE A MODDER don't distribute this file with your mod. Create a new
    // file `MyMod.cfg` that has the same structure as this one but only containing
    // options you wish to override.
    
    TextureReplacer
    {
      // Texture compression reduces textures size to 1/6 or 1/4 and hence reduces
      // memory usage (video and possibly also RAM if a texture is "readable") and
      // improves performance (less data has to be transferred to GPU).
      // Possible options: `always`, `never` and `auto`. Auto means it is enabled
      // unless Active Texture Management mod is detected.
      isCompressionEnabled = auto
    
      // Generate mipmaps for PNGs and JPEGs in certain directories (specified in
      // the next option) to a fix KSP bug that doesn't generate mipmaps for these
      // images and makes them look ugly under sharp angles.
      // Possible options: `always`, `never` and `auto`. Auto means it is enabled
      // unless Active Texture Management mod is detected.
      isMipmapGenEnabled = auto
    
      // List of regular expressions that trigger mipmap generation when matching
      // the path of a texture that is missing mipmaps. These should cover all model
      // textures but not UI icons. The strings are case-sensitive on all platforms.
      // The list must be space- and/or comma-separated and in one line.
      // Duplicated lists are joined.
      generateMipmaps = /FX/ /Parts/ /Props/ /Spaces/ ^ART/ ^ASET(_Props)?/ ^FASA/
      generateMipmaps = ^KAS/ ^Lionhead_Aerospace_Inc/ ^Regolith/Assets/
      generateMipmaps = ^RetroFuture/ ^UmbraSpaceIndustries/
    
      // Some textures (all JPEGs, PNGs and TGAs plus MBM tagged as "readable") are
      // kept loaded in RAM. Since this feature is rarely actually needed those
      // textures can be unloaded just before the main menu.
      // Possible options: `always`, `never` and `auto`. Auto means it is enabled
      // unless Active Texture Management mod is detected.
      isUnloadingEnabled = auto
    
      // Prevent unloading for textures whose paths match the following regular
      // expressions. Some mods access and modify textures, so those shouldn't be
      // unloaded.
      // The list must be space- and/or comma-separated and in one line.
      // Duplicated lists are joined.
      keepLoaded = ^BoulderCo/(Clouds|Atmosphere)/ ^CommunityResourcePack/
      keepLoaded = ^Romfarer/textures/ ^WarpPlugin/PlanetResourceData/
    
      // Dump material/texture name pairs to log when performing general texture
      // replacment pass. Log entries are of the form "[materialName] textureName".
      // This option is intended for texture pack designers.
      logTextures = false
    
      // Dump names of all meshes with corresponding shaders on parts with
      // TRReflection part module.
      // This option is intended for part designers.
      logReflectiveMeshes = false
    
      // Replace helmet visor shader to support reflections (EVA only).
      isVisorReflectionEnabled = true
    
      // Reflection colour. Reflection is multiplied by this RGB colour before it is
      // added to the visor colour.
      visorReflectionColour = 1 1 1
    
      // Remove IVA helmets in safe situations (landed/splashed and in orbit).
      isHelmetRemovalEnabled = true
    
      // Spawn a Kerbal on EVA in his/her IVA suit without helmet and jetpack when
      // in breathable atmosphere (+ sufficent pressure).
      isAtmSuitEnabled = true
    
      // Minimum air pressure required for a Kerbal to spawn in his/her IVA suit.
      atmSuitPressure = 0.5
    
      // List of planets/moons with breathable atmospheres where Kerbals spawn in
      // their IVA suits.
      // The list must be space- and/or comma-separated and in one line.
      // Duplicated lists are joined.
      atmSuitBodies = Kerbin
    
      // Enable "Toggle EVA Suit" option in the right-click menu for Kerbal EVAs.
      isEVASuitToggleEnabled = true
    
      CustomKerbals
      {
        // Custom heads and suits for specific Kerbals. Entries are of the form:
        //
        //   Name = headTex [suitDir]
        //
        // where `headTex` is an image (without extension) inside `Heads/` and
        // `suitDir` is a subdirectory inside `Suits/` containing textures for a
        // suit. `DEFAULT` keeps the default head/suit textures from `Default/` and
        // `GENERIC` assigns a generic head/suit using the same rules as for the
        // generic Kerbals. If `suitDir` is missing then `GENERIC` is assumed.
        //
        // Examples:
        //
        //   Huey Kerman    = head1 Suit1
        //   Dewey Kerman   = head2 DEFAULT
        //   Louie Kerman   = head3
        //   Donald Kerman  = DEFAULT DEFAULT
        //   Daisy Kerman   = DEFAULT
        //   Scrooge Kerman = GENERIC Suit2
        //
      }
    
      GenericKerbals
      {
        // Prevent the following heads from being assigned to generic Kerbals.
        // The list must be space- and/or comma-separated and in one line.
        // Duplicated lists are joined.
        excludedHeads =
    
        // Prevent the following suits from being assigned to generic Kerbals.
        // The list must be space- and/or comma-separated and in one line.
        // Duplicated lists are joined.
        excludedSuits =
    
        // Female heads. Texture names inside `Heads/` (without extensions).
        // The list must be space- and/or comma-separated and in one line.
        // Duplicated lists are joined.
        femaleHeads =
    
        // Female suits. Directory names inside `Suits/`.
        // The list must be space- and/or comma-separated and in one line.
        // Duplicated lists are joined.
        femaleSuits =
    
        // A Kerbal is regarded as female if her name (the last word/surname is
        // ignored) matches one of these regular expressions.
        // The list must be space- and/or comma-separated and in one line.
        // Duplicated lists are joined.
        femaleNames = [ei][elns]$ [belmns]y$ i(ng)?$ [au]$ oe$
    
        // Eye-less heads. Eyes will be hidden for those heads, so one can paint
        // custom ones on the head texture.
        // The list must be space- and/or comma-separated and in one line.
        // Duplicated lists are joined.
        eyelessHeads =
    
        // Whether generic suits should be assigned pseudo-randomly based on a
        // Kerbal's name's hash or consecutively based on a Kerbal's position in
        // the global roster.
        // If role-based suits exist, they will override this setting.
        // Possible options: `random` or `consecutive`.
        suitAssignment = random
    
        // Number used to multiply hash of a Kerbal's name when randomly assigning
        // heads. You can tweak this number to change randomisation. Usually, the
        // best randomisation is achieved when this number is a large prime number.
        headMultiplier = 4099
    
        // Number used to multiply hash of a Kerbal's name when randomly assigning
        // suits. You can tweak this number to change randomisation. Usually, the
        // best randomisation is achieved when this number is a large prime number.
        suitMultiplier = 2053
    
        // Commander suit is used for Kerbals whose highest skill is "Command" as
        // reported by KerbalStats.
        commanderSuit =
    
        // Pilot suit is used for Kerbals whose highest skill is "Pilot" as
        // reported by KerbalStats.
        pilotSuit =
    
        // Scientist suit is used for Kerbals whose highest skill is "Science" as
        // reported by KerbalStats.
        scientistSuit =
    
        // Passenger suit is used for Kerbals whose highest skill is "Passenger" as
        // reported by KerbalStats.
        passengerSuit =
      }
    
      CabinSuits
      {
        // Cabin-specific suits. These are enforced even if a Kerbal has a custom
        // suit. Entries are of the form:
        //
        //   partName = suitDir
        //
        // where `partName` is the name of a part (`name = ...` in `part.cfg`) and
        // `suitDir` is either a suit directory from `Suits/` or `DEFAULT`.
        //
        // NOTE: Any underscores in `partName` must be replaced by periods.
        //
        // Examples:
        //
        //   Mark1Cockpit = PilotSuit
        //   crewCabin = DEFAULT
        //
      }
    }
    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).

    Normal Maps
    Unity uses "grey" normal maps (RGBA = YYYX) to avoid artefacts when applying DXT5 texture compression on them. When a normal map has a "NRM" suffix Unity converts it from RGB = XYZ ("blue") to RGBA = YYYX ("grey") normal map unless DDSLoader is used to load it.

    In short: you should supply "blue" normal maps when image has "NRM" suffix and is in PNG format (JPEGs and TGAs are not recommended for normal maps) and "grey" normal maps when DDS format is used or the texture does not have "NRM" suffix.

    "Grey" normal maps can be created by saving the standard "blue" normal map as a DDS with DXT5nm compression or by manually shuffling its colour channels RGBA -> GGGR.

    Notes
    • Use DDS format (requires DDSLoader) for optimal RAM usage and loading times since they are not shadowed in RAM and can be pre-compressed and can have pre-generated mipmaps.
    • TGA and JPEG images are not suitable for normal maps.
    • 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.]
    • 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.]

    ChangeLog
    • 1.10.2
      - fixed visor shader loading
    • 1.10.1
      - changed the way how texture replacements for KerbalEVA are triggered
      - further optimised personalised IVA replacements
      - the state of EVA suit is saved for Kerbals on EVA
      - when conditions for IVA suit are not met any more, a Kerbal on EVA automatically wears EVA suit
      - removed `isToggleEvaSuitEnabled` config option, the EVA PartModule is now mandatory for texture replacement to work
    • 1.10
      - added "Toggle EVA Suit" option to Kerbal context menu
      - optimised Kerbal personalisation by removing many redundant replacements
      - old textures are really unloaded when replaced by textures from `Default/`
      - updated default configuration for new mods
    • 1.9.2
      - fixed crash when there is no navball replacement texture
    • 1.9.1
      - updated configuration to cover more mods
      - omitted navballs from mipmap generation
      - fixed crash when there are no Kerbal suits
      - fixed crash when environment map textures are not readable
    • 1.9
      - added integration with KerbalStats (optional) for gender determination and experience-based suit assignment
      - new `commanderSuit`, `pilotSuit`, `scientistSuit`, `passengerSuit` config options for experience-based suits
      - new `headMultiplier` and `suitMultiplier` options for tweaking randomisation algorithm for head and suit assignment
      - added support for setting normal map of the default head
      - fixed IVA helmet removal when using the default suit
      - fixed a crash which might occur when rebuilding game database
    • 1.8.1
      - fixed crash when environment map is missing
    • 1.8
      - added TRReflection part module for visor-like reflections on parts
      - added support for NavBall texture replacement
      - added a configurable list of bodies with breathable atmospheres (since not all atmospheres with oxygen are breathable, e.g. Laythe)
      - added extras: low-res environment map textures, Module Manager script to add the new reflections to some stock parts

    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; Yesterday at 20:20. Reason: released 1.10.2

  2. #2
    Junior Rocket Scientist therealcrow999's Avatar
    Join Date
    Mar 2012
    Location
    Elmira, NY
    Posts
    730
    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
    730
    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
    473
    @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
    730
    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
    473
    @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
    730
    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
    730
    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
  •