shaw

[1.6.x] TextureReplacer 3.7 (25.1.2019)

Recommended Posts

rkEC1xG.jpg
Full album
TextureReplacer

Kerbal personalisation, IVA suits on Kerbin and texture replacement and improvements.

The old thread was closed since I wasn't able to edit OP any more due to some forum bug.

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 lowered frame rate and caused 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,
  • assign personalised skin and suit textures for each Kerbal,
  • assign suits based on class and experience level,
  • toggle between EVA suit and IVA suit without helmet in breathable atmosphere,
  • add reflections to parts and helmet visors and
  • change bilinear texture filter to trilinear to improve mipmap quality.

Special thanks to:

  • RangeMachine for contributing reflection shaders and maintaining the mod in my absence.
  • rbray89 who contributed a reflective visor shader and for [thread=59005]Active Texture Management[/thread] and [thread=55905]Visual Enhancements[/thread] where some code has been borrowed from,
  • Tingle for [thread=44135]Universe Replacer[/thread]; studying his code helped me a lot while developing this plugin,
  • taniwha for [thread=99018]KerbalStats[/thread] that was optionally used by this plugin for gender determination and role-based suit assignment,
  • Razchek and Starwaster for [thread=70089]Reflection Plugin[/thread] where I learnt how to implement reflections,
  • sarbian for fixing an issue with non-multiple-of-4 texture dimensions,
  • therealcrow999 for testing and benchmarking this plugin,
  • Ippo343 for contributing KSP-AVC configuration,
  • JPLRepo for contributing DeepFreeze compatibility fixes,
  • Proot, Scart91, Green Skull and many others for creating texture packs and
  • Sylith and Scart91 for giving others permissions to make derivatives of their texture packs.

Links

Texture Packs

Legend: Heads, Suits, Galaxy skybox, celestial Bodies, Parts.


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 textures are of the form

    GameData/**/TextureReplacer/Default/<internalName>

where `<internalName>` is the texture's internal name in KSP or path of a texture inside `GameData/` (plus `.dds`/`.png`/`.jpg`/`.tga` extension, of course).

Examples:

    GameData/**/TextureReplacer/
      Default/kerbalHead                  // teeth and male head
      Default/kerbalGirl_06_BaseColor     // female head
      Default/kerbalMain                  // IVA suit (veteran/orange)
      Default/kerbalMainGrey              // IVA suit (standard/grey blue)
      Default/kerbalMainNRM               // IVA suit normal map
      Default/kerbalVisor                 // IVA helmet visor
      Default/EVAtexture                  // EVA suit
      Default/EVAtextureNRM               // EVA suit normal map
      Default/EVAvisor                    // EVA helmet visor
      Default/EVAjetpack                  // EVA jetpack
      Default/EVAjetpackNRM               // EVA jetpack normal map

      Default/NavBall                     // HUD & IVA NavBall

      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:

    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 Kerbals' helmets and on parts that include `TRReflection` module that can be used like in the following example adding reflections onto the windows of Mk1-2 pod:

    MODULE
    {
      name = TRReflection
      shader = Reflective/Bumped Diffuse
      colour = 1.0 1.0 1.0
      interval = 1
      meshes = FrontWindow SideWindow
    }

There are several parameters, all optional:

  • `shader`: Most shaders should be automatically mapped to their reflective counterparts. In some cases, however, there are no reflective version of a shader, so you will have to manually specify appropriate shader.
  • `colour`: Reflection is pre-multiplied by this RGB value before added to the material. `1.0 1.0 1.0` by default.
  • `interval`: Once in how many steps the reflection is updated. `1` by default.
  • `meshes`: Space- and/or comma-separated list of mesh names where to apply reflections. Reflection is applied to whole part if this parameter is empty or non-existent. You may find `logReflectiveMeshes` configuration option very helpful as it prints names of all meshes for each part with `TRReflection` module into your log.

One face of one reflection cube texture is updated every `reflectionInterval` frames (`4` by default, it can be changed in a configuration file), so each reflective part has to be updated six times to update all six texture faces. More reflective parts there are on the scene less frequently they are updated. `interval` field on TRReflection module can lessen the update rate for a part; e.g. `interval = 2` makes the part update half less frequently.

Personalised Kerbal Textures

Skins and suits are assigned either manually or automatically (configured in the GUI while configuration files can provide initial settings). "Random" assignment of skins and suits is based on Kerbals' names, which ensures the same skin/suit is always assigned to a given Kerbal. Additionally, special per-class suit can be set for each class.

Skin textures reside inside `Skins/` directory, each in its own subdirectory:

    GameData/**/TextureReplacer/
      Skins/[<subDir>/]<skin>/kerbalHead    // Head texture
      Skins/[<subDir>/]<skin>/eyeballLeft   // Left eyeball
      Skins/[<subDir>/]<skin>/eyeballRight  // Right eyeball
      Skins/[<subDir>/]<skin>/pupilLeft     // Left pupil
      Skins/[<subDir>/]<skin>/pupilRight    // Right pupil

for males and

    GameData/TextureReplacer/
      Skins/[<subDir>/]<skin>/kerbalGirl_06_BaseColor  // Head texture
      Skins/[<subDir>/]<skin>/eyeballLeft              // Left eyeball
      Skins/[<subDir>/]<skin>/eyeballRight             // Right eyeball
      Skins/[<subDir>/]<skin>/pupilLeft                // Left pupil
      Skins/[<subDir>/]<skin>/pupilRight               // Right pupil

for females.

Suit textures' names are identical as for the default texture replacement except that class level variants of suit texture are possible. If `kerbalMain` is not present `kerbalMainGrey` is used for veterans. Each suit must reside inside its own directory:

    GameData/TextureReplacer/
      Suits/[<subDir>/]<suit>/kerbalMain       // IVA suit (veteran)
      Suits/[<subDir>/]<suit>/kerbalMainGrey   // IVA suit (level 0)
      Suits/[<subDir>/]<suit>/kerbalMainGrey1  // IVA suit (level 1)
      Suits/[<subDir>/]<suit>/kerbalMainGrey2  // IVA suit (level 2)
      Suits/[<subDir>/]<suit>/kerbalMainGrey3  // IVA suit (level 3)
      Suits/[<subDir>/]<suit>/kerbalMainGrey4  // IVA suit (level 4)
      Suits/[<subDir>/]<suit>/kerbalMainGrey5  // IVA suit (level 5)
      Suits/[<subDir>/]<suit>/kerbalMainNRM    // IVA suit normal map
      Suits/[<subDir>/]<suit>/kerbalVisor      // IVA helmet visor
      Suits/[<subDir>/]<suit>/EVAtexture       // EVA suit (level 0)
      Suits/[<subDir>/]<suit>/EVAtexture1      // EVA suit (level 1)
      Suits/[<subDir>/]<suit>/EVAtexture2      // EVA suit (level 2)
      Suits/[<subDir>/]<suit>/EVAtexture3      // EVA suit (level 3)
      Suits/[<subDir>/]<suit>/EVAtexture4      // EVA suit (level 4)
      Suits/[<subDir>/]<suit>/EVAtexture5      // EVA suit (level 5)
      Suits/[<subDir>/]<suit>/EVAtextureNRM    // EVA suit normal map
      Suits/[<subDir>/]<suit>/EVAvisor         // EVA helmet visor
      Suits/[<subDir>/]<suit>/EVAjetpack       // EVA jetpack
      Suits/[<subDir>/]<suit>/EVAjetpackNRM    // EVA jetpack normal map

The level textures are optional. If a level texture is missing the one from the previous level is inherited. If the veteran texture is present it is used for all levels on veterans.Configuration File

NOTE: All options that can be configured in the GUI are saved per-game and not in the configuration files. Configuration files only provide initial settings for those options.

Main/default configuration file:

    GameData/TextureReplacer/@Default.cfg

One can also use additional configuration files; configuration is merged from all `*.cfg` files containing `TextureReplacer { ... }` as the root node. This should prove useful to developers of texture packs so they can distribute pack-specific skin/suit assignment rules in a separate file. All `*.cfg` files (including `@Default.cfg`) are processed in alphabetical order (the leading `@` in `@Default.cfg` ensures it is processed first and overridden by subsequent custom configuration files).

Normal Maps

Unity uses grey normal maps (RGBA = YYYX) to minimise 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 it is in DDS format.

In short: you should supply blue normal maps when a texture has `NRM` suffix and is in PNG format (JPEGs and TGAs are not recommended for normal maps) and grey normal map for textures in DDS format or without `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 channels RGBA -> GGGR.

Kerbal Model Hierarchy

Full hierarchy of Kerbal models, together with all default shaders and textures, useful for modders: http://pastebin.com/6QgES3Ae

Notes

  • Use DDS format for optimal RAM usage and loading times since DDS textures are not shadowed in RAM and can be pre-compressed and can have pre-built mipmaps.
  • TGA and JPEG images are not suitable for normal maps.
  • Try to keep dimensions of all textures powers of two.
  • KSP can only load TGAs with RGB or RGBA colours. Paletteised 256-colour TGAs cause corruptions in the game database!
  • By default, texture compression and mipmap generation are handled by [thread=59005]ATM[/thread] when it is 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 the high-resolution ones that cannot be replaced by this plugin.

Known Issues

  • When using stock vintage suits, EVA suit is used for IVA.
  • Reflections disable part highlighting along reflective surfaces.
  • Only the top face of the atmospheric skybox is reflected.
  • Issues with other plugins:
    • EVE clouds are not reflected at certain altitudes.
    • Ship Manifest crew transfers reset Kerbals to default textures (restored on vessel switch or scene reload).

ChangeLog

Full changelog

Credits & Licence

This plugin is distributed under the MIT licence. shaw is the main author, while some parts (visor shader, texture compression and mipmap generation) are based on rbray89's code.

Spoiler

Plugin: MIT

    Copyright © 2013-2019 Davorin Učakar
    Copyright © 2016 RangeMachine
    Copyright © 2013 rbray89

    Permission is hereby granted, free of charge, to any person obtaining a
    copy of this software and associated documentation files (the "Software"),
    to deal in the Software without restriction, including without limitation
    the rights to use, copy, modify, merge, publish, distribute, sublicense,
    and/or sell copies of the Software, and to permit persons to whom the
    Software is furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in
    all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
    THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    DEALINGS IN THE SOFTWARE.

Skins: CC BY 4.0

    This pack can be modified and distributed under the terms of CC BY 4.0
    licence. The original author is Sylith, with additional modifications by
    shaw and IOI-655362.

Edited by shaw
released 3.7

Share this post


Link to post
Share on other sites

Exciting things and also vbulletin problems!

Share this post


Link to post
Share on other sites

Pole position in one of the best mods ever! the old thread is broke or what? Is kinda sad, the other one had history...

Share this post


Link to post
Share on other sites

16eTcib.png

I totally agree with those reflections! So nice having it deepspace, in eva. If the screen is to big let me know and i make it smaller

cheers for your work!!

Share this post


Link to post
Share on other sites
Pole position in one of the best mods ever! the old thread is broke or what? Is kinda sad, the other one had history...

[thread=107264]That's what happened[/thread] with the old thread.

Share this post


Link to post
Share on other sites

Is it possible to turn off the part surface reflections only? I have a number of part mods installed, and don't like having a half shiny vessel...

Share this post


Link to post
Share on other sites
Is it possible to turn off the part surface reflections only? I have a number of part mods installed, and don't like having a half shiny vessel...

Delete MM_Reflections.cfg. Anyway, this file is not part of "standard" TR installation, you must have copied it from Extra/.

- - - Updated - - -

http://i.imgur.com/16eTcib.png

I totally agree with those reflections! So nice having it deepspace, in eva. If the screen is to big let me know and i make it smaller

cheers for your work!!

W.T.F.? Cloud reflections in high space? That shouldn't work.

What version of EVE (and which EVE pack) do you use? I was trying to make clouds reflections work in scaled space, but with no luck.

Edited by shaw
dam.n forum censors w.t.f

Share this post


Link to post
Share on other sites

Is this still mucking up contracts? Would like to use it but I don't want to lose contracts.

Share this post


Link to post
Share on other sites

I just installed this mod again, and I did copy the extras stuff, but parts aren't showing reflections......which is great....but that means I have diverse heads in the wrong spot. Where should that .cfg go?

(Thanks for letting me know how to turn off part reflections for future installs....yay!)

Share this post


Link to post
Share on other sites

New thread!? Now the third big thread for a texture mod. After universe replacer and texture replacers old thread. :D

I wanted to ask, if someone could make some Mass Effect suites and Kerbal Heads.

Share this post


Link to post
Share on other sites
I just installed this mod again, and I did copy the extras stuff, but parts aren't showing reflections......which is great....but that means I have diverse heads in the wrong spot. Where should that .cfg go?

(Thanks for letting me know how to turn off part reflections for future installs....yay!)

All CFGs will work anywhere inside GameData/. Of course, putting them into GameData/TextureReplacer/ is the most obvious choice.

- - - Updated - - -

Is this still mucking up contracts? Would like to use it but I don't want to lose contracts.

Hopefully not and never did. Are you really sure it was TR's fault?

Share this post


Link to post
Share on other sites
All CFGs will work anywhere inside GameData/. Of course, putting them into GameData/TextureReplacer/ is the most obvious choice.

- - - Updated - - -

Hopefully not and never did. Are you really sure it was TR's fault?

That is what NathanKell told me and I usually trust him. I haven't tried it for myself.

Share this post


Link to post
Share on other sites

You should see it entering the atmos :D so ...... Haha. Hmm i think it is the older stable one, 7-3, not the newly wip one. And astronomers interstellar v2

Share this post


Link to post
Share on other sites
You should see it entering the atmos :D so ...... Haha. Hmm i think it is the older stable one, 7-3, not the newly wip one. And astronomers interstellar v2

I just checked, no clouds in my helmet reflections. Using a copied-over version of EVE (7-3) from my 0.25 save along with textures from various packs. My cloud layers are from Better Atmospheres

Taken from 100km orbit

GMyBwGWl.png

Edited by Gaiiden

Share this post


Link to post
Share on other sites

It might be 7-4, im not sure if i modified the cloudslayers but that shouldnt affect the reflections ?

All the dll files from eve is from 11-26 2014

SfC0N2Xl.png

Edited by ahappydude

Share this post


Link to post
Share on other sites

Reflections are awesome. I love how this was like an upgraded and supported alternative to Universe Replacer and now it's so much more than that. Shame the old thread broke, but I suppose a fresh start isn't bad either.

Share this post


Link to post
Share on other sites
Is this still mucking up contracts? Would like to use it but I don't want to lose contracts.

TextureReplacer has never had an issue with messing up contracts. Whatever issue you were having was from a different mod, almost certainly.

That is what NathanKell told me and I usually trust him. I haven't tried it for myself.

Not sure where he heard that but if he told you it messed up his contracts he probably was having an issue with another mod and for some reason thought it was TextureReplacer's fault. This mod doesn't make any changes to those files, so I can't imagine any way it would be able to mess up contracts.

Edited by Pingonaut

Share this post


Link to post
Share on other sites
It might be 7-4, im not sure if i modified the cloudslayers but that shouldnt affect the reflections ?

All the dll files from eve is from 11-26 2014

Nope, 7-4 files are dated 4/18 and it was just a license change from 7-3 anyways. Rbray started his experimentals build thread on the forums 11-22 so looks like you're running a very early experimental build. I'd try it myself but for some reason GitHub is responding but taking forever to load anything. Will try tomorrow

Share this post


Link to post
Share on other sites

I'm getting no reflections at all, apart from the SkyBox. I've put the MM_Reflections in the TR folder.

Share this post


Link to post
Share on other sites

Using the EVE experimental build linked on the first post of the dev thread:

iQcSdu8l.png

Oh well. At this point I'll leave it up to shaw to determine if ahappydude has some kind of special magical install or is a very artistic troll

Share this post


Link to post
Share on other sites

I have the Green Skull suits pack installed, now how do I take off the EVA helmets?

Also, obligatory first post.

Share this post


Link to post
Share on other sites

Im sorry to say im neither a troll or have a magical install .p di you find the same version of eve? Can it have anything to do with these i changedfrom deafult.cfg?

reflectionResolution = 512

// Number of frames between reflection updates for a part. Only one face of

// the environment map is updated at once, so 6 updates are necessary for full

// update.

reflectionInterval = 2

// Replace helmet visor shader to support reflections (EVA only).

isVisorReflectionEnabled = true

- - - Updated - - -

I have the Green Skull suits pack installed, now how do I take off the EVA helmets?

Also, obligatory first post.

Right click mate

Edited by ahappydude

Share this post


Link to post
Share on other sites
*snip*

Doesn't work, here's a screen of the context menu.

http://imgur.com/fGxyxkb

Also have some more mods installed, here's a list.

BDArmory

BoatParts

BurnTogether

Chatterer

DDSLoader

Modular Kolonization System (and dependencies)

KAS

Kethane

Parameciumkid's jump drive

TextureReplacer.

I think it might be either BoatParts or one of the outdated mods. I'll try that.

Edited by Montosoy9

Share this post


Link to post
Share on other sites

Hmm.. Are you sure you got the latest version of texturereplacer firstly, second check the deafult cfg for isHelmetRemovalEnabled = true , third try without Modular Kolonization System.

Its hard to pinpoint but my guess is that another mod that changes what you do when right clicking are interferring? hmm best of luck!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now