Jump to content

[1.12.x] Recolour Collection


Recommended Posts

6 hours ago, Arqane said:

Am I doing something wrong? Can't get metallic textures to show.

No, this is because none of the parts i have recoloured have proper metallic gloss maps, this is because to make them you take the original texture and put it through some filters, i cant do this for the Near Future stuff as it has an all rights reserved license which does not allow redistribution of its textures (which is what i would be doing).

To get a similar-ish result try turning detail down and specular / metallic up. (fun fact: you can actually go all the way up to 999 if, instead of using the slider, you type it into the box to the right of the slider).

Link to comment
Share on other sites

2 minutes ago, ZZetho said:

No, this is because none of the parts i have recoloured have proper metallic gloss maps, this is because to make them you take the original texture and put it through some filters, i cant do this for the Near Future stuff as it has an all rights reserved license which does not allow redistribution of its textures (which is what i would be doing).

To get a similar-ish result try turning detail down and specular / metallic up. (fun fact: you can actually go all the way up to 999 if, instead of using the slider, you type it into the box to the right of the slider).

I've been just running my _Paint file through gimp, stripping out the saturation, deleting any black in the image, and setting transparency in the remaining portion to somewhere between 70% and 88%.. I never actually used the original files at all, except maybe as a template.  Maybe I've been doing it wrong, and it will show when I go back through to add 'Its All Shiny' to my mods, but I reckon you may be able to use that as a workaround to avoid any legal faux pas.  If your paint file is a completely new creation, and you use it to make a metallic file, isn't that also a new creation?

In fact it's my understanding that even the most restrictively licensed mod can have TURD capabilities added to it, because the _Paint and _Metallic files can be made without actually using a single pixel of the original image and instead drawing a new layer by hand, meticulously.  Yes, that layer is (loosely) based on another file, in the same sense a painting can be base on a real image.  I believe that a texture file that is a derivation of another texture file, drawn by hand, piece by piece, and containing none of its original pixels would be technically covered by the 'Fair Use' doctrine, especially since the to images will by, by any standard, vastly different in everything but associated patterns.  By extension, I further declare that there is no mod safe from TURDification, save for those whose configs were written in such a way as to make it too convoluted, frustrating, and difficult to complete.  In all honestly it was this aspect of the TURD that appealed to me the most: how many mods were there out there left in a state of incompleteness?  A helluva lot, that's how many.  Many of these that fell by the wayside did so because they have licensure that didn't allow for adoption or continuation, and usually because the creator also fell out of the KSP community and could not be reached for permission for such things.  Instead of letting these mods die, those that are still functional can be given a resuscitative breath of fresh air, legally, above board, just the same as making a community tech tree compatibility config for a mod. 

Link to comment
Share on other sites

30 minutes ago, ZZetho said:

No, this is because none of the parts i have recoloured have proper metallic gloss maps, this is because to make them you take the original texture and put it through some filters, i cant do this for the Near Future stuff as it has an all rights reserved license which does not allow redistribution of its textures (which is what i would be doing).

To get a similar-ish result try turning detail down and specular / metallic up. (fun fact: you can actually go all the way up to 999 if, instead of using the slider, you type it into the box to the right of the slider).

Same here, too inexperienced to create glossic maps, I just feed it one from Default folder lmao. Also I never realised about legal technicalities, oh well, I hope Restock isn't that harsh:/

Also you can go farther than 255?! Let's go! Jeb, into that shiny shiny metal ball, NOW

Link to comment
Share on other sites

10 minutes ago, UncleMateo said:

I've been just running my _Paint file through gimp, stripping out the saturation, deleting any black in the image, and setting transparency in the remaining portion to somewhere between 70% and 88%..

I think this has the same effect as putting a

PROPERTY

{
            name = _Metal
            float = 0.8
}

in the material node (because the image will have the same values everywhere?).

5 minutes ago, MrShelter said:

I hope Restock isn't that harsh

It also has an all rights reserved license for its textures, this just means you cant redistribute them.

Link to comment
Share on other sites

Spoiler
22 hours ago, ZZetho said:

Textures Unlimited Recolouring Tutorial pt2 (meshes).

Part one:

You should first have a basic understanding of module manager syntax (what all the symbols do), you can find that on the module manager wiki.

First of all, Every part in KSP is defined by a config (.cfg) file, this determines all of the properties of the part, including its model.

Every part has at least one (and usually only one) model (.mu) that determines what shape the part is, defined by either "mesh = SomeModel.mu" or 

MODEL
{
        model = Mod/PartsOrSomething/EnginesAndWhatnot/SomeModel
}

Every model contains at least one mesh, each mesh uses exactly one material to determine what the mesh looks like (multiple meshes can use the same material).

Materials contain a set number of textures that determine what meshes that use this material will look like.

ie: meshes are shapes that have materials painted on to them which are then combined to form a model that, when combined with some properties in the config file, makes a part.

"To draw something in Unity, you must provide information that describes its shape, and information that describes the appearance of its surface. You use meshes to describe shapes, and materials to describe the appearance of surfaces."

  - the Unity manual "Materials introduction".

For example:

qCwfodc.png

You can find the meshes of a part by finding the part's ModelData.txt file mentioned in the last part of this tutorial. It contains the name of every mesh as well as the full details for the material that is used for that mesh, including which shader the material uses which will be important later.

ModelData.txt for the Nerv nuclear engine:

7fjfFzX.png

In this case we have three meshes (engine, obj_gimbal and fairingL) and two materials (NTR and ntrfairing), with two of the meshes using the same material.

What we want to do is to make our own materials and have the meshes of a part be able to switch between the default textures and recolour ones. To do this we need to add a KSPTextureSwitch module, something that is added by Textures Unlimited which allows the texture set of a part to be changed. A texture set is effectively just a material plus some other properties (such as if they are recolourable or not), two of them were made near the start of part 1 of this tutorial, these are used as a template that can be copied and edited. Parts don't come with a texture set so we have to make our own, this includes fully recreating the material that the part originally used (the default texture set) and making at least one recolourable texture set. If two meshes use the same material then they can use the same texture switcher, if not they must use different texture switchers.

CwDhM6s.png

To do this the template texture sets that are defined in the TextureSets config file are copied and edited to have the properties / textures we want (see part 1). By default a texture set's material is applied to every mesh in a part, to prevent this the meshes that the material should / shouldn't be applied to can be specified in the MATERIAL node in a texture set by using "mesh = MeshThatShouldBeUsingThisMaterial" to apply a material to only those meshes (whitelist) and "excludeMesh = MeshThatShouldlntBeUsingThisMaterial" to apply a material to every mesh except those meshes (blacklist). Usually you should only be using one or the other of these for each texture set. You can often tell what meshes are by their name, if that fails you can open the model in blender, the objects will have the same names. A tutorial on how to do that (this also gives colliders but these can be ignored). If that too fails your next best hope is the Debug Stuff mod, turn on Labels to see the names of meshes (and also a bunch of other stuff).

Another thing to look out for is materials that use different shaders, in ModelData the shader that each material uses is specified, for the default texture set to look the same as the original texture the shader has to also be the same. The shader that the template default texture set uses is "KSP/Emissive/Bumped Specular" (so if that's what the material you're trying to recreate uses you don't have to do this) and can be changed with "@shader = SomeShader" in the MATERIAL node, don't change the shader in the recolour texture set.

For example:

cIByG02.png

At this point, when you launch the game the part that is being recoloured should have multiple texture switches which each control the recolouring of a portion of the part.

Things of note:

- It is possible to leave a mesh completely untouched, if every material excludes it then it will keep its original textures, this is used for meshes that should never be recoloured, for example the meshes that flags go on or meshes used for particle effects (Shader Name : KSP/Particles).

- You don't have to use one texture switcher for a group of meshes that all use the same material, you can split them up into different switchers so they are independently recolourable if you'd like.

- Many meshes may use the same texture set if they all use the same materials. This means that the meshes of multiple parts can be recoloured at once by using @PART[part1,part2,part3], keep in mind that this will add KSPTextureSwitch modules to each of the parts so if you add another KSPTextureSwitch module to one of the parts to recolour a mesh that uses a unique material then when you add the recolour texture set in the recolour config file it will not be the first KSPTextureSwitch  any more so the number after @MODULE[KSPTextureSwitch] will not be a zero any more.

- If multiple models (.mu) are being recoloured, either because multiple parts are being recoloured or a part is made of multiple models, the whitelist / blacklist from mesh =  and excludeMesh = is only applied per-model, meaning that there are situations where it makes sense to have both mesh = and excludeMesh = in a single material (use this material for only these meshes in one model and all meshes except these in another model), assuming the models have no meshes with the same name (have a look at the generics section in the default and recolour files of my near future launch vehicles recolour for examples).

- You can add as many recolour texture sets as you want to a texture switcher by putting more than one "textureSet = SomeTextureSet" in a @MODULE[KSPTextureSwitch] node (have a look at the fuel tanks section in the recolour file of my near future launch vehicles recolour for examples).

Common issues:

- The number after @MODULE[KSPTextureSwitch], is wrong, this makes switchers have too many / two few options as texture sets are added to the wrong one. The number corresponds to which number KSPTextureSwitch module is being edited. Modules are numbered in the order they were created, starting from zero, so the third one would be number 2.

- Texture sets have the same name, make sure every texture set has a unique name.

 

Awesome!  I will analyze this more completely tomorrow, I have no doubt it will teach me something new 

Admittedly I've never used Blender so far,  believe it or not, so that part will probably be quite informative!

Link to comment
Share on other sites

6 minutes ago, UncleMateo said:

so that part will probably be quite informative!

Blender is incredibly usefully, not just for finding out what meshes are what but also for finding what part of a texture is used where.

1. flip a texture vertically and save as a png.

2. open a model in blender.

3. delete all the unimportant stuff (colliders).

4. in the shading tab, import the png texture.

5. still in the shading tab, click on a mesh (this opens a bunch of nodes in the shader editor) and, in the _MainTex node, change its texture to the new one.

6. it should look wrong, this is expected.

7. go into the texture paint tab, you'll probably have to click on the + and go through a drop down menu  to get the option to open it.

8. you should now have a window where you can paint directly onto the model and a window that shows the texture you are painting. You can use this to find out what bits of the model use which bits of the texture.

Link to comment
Share on other sites

5 minutes ago, ZZetho said:

Blender is incredibly usefully, not just for finding out what meshes are what but also for finding what part of a texture is used where.

1. flip a texture vertically and save as a png.

2. open a model in blender.

3. delete all the unimportant stuff (colliders).

4. in the shading tab, import the png texture.

5. still in the shading tab, click on a mesh (this opens a bunch of nodes in the shader editor) and, in the _MainTex node, change its texture to the new one.

6. it should look wrong, this is expected.

7. go into the texture paint tab, you'll probably have to click on the + and go through a drop down menu  to get the option to open it.

8. you should now have a window where you can paint directly onto the model and a window that shows the texture you are painting. You can use this to find out what bits of the model use which bits of the texture.

Wow.. with Fuji that would have saved me a lot of effort.  The texture files for that mod were a little more difficult to interpret than most.  I can sometimes be unintentionally stubborn about such things.

Link to comment
Share on other sites

27 minutes ago, ZZetho said:

Blender is incredibly usefully, not just for finding out what meshes are what but also for finding what part of a texture is used where.

1. flip a texture vertically and save as a png.

2. open a model in blender.

3. delete all the unimportant stuff (colliders).

4. in the shading tab, import the png texture.

5. still in the shading tab, click on a mesh (this opens a bunch of nodes in the shader editor) and, in the _MainTex node, change its texture to the new one.

6. it should look wrong, this is expected.

7. go into the texture paint tab, you'll probably have to click on the + and go through a drop down menu  to get the option to open it.

8. you should now have a window where you can paint directly onto the model and a window that shows the texture you are painting. You can use this to find out what bits of the model use which bits of the texture.

That sounds extremely useful! Well, now I need to figure out how to make it work lol, I know there's plugin for .mu models, but I need to figure out other steps.

Link to comment
Share on other sites

13 hours ago, ZZetho said:

No, this is because none of the parts i have recoloured have proper metallic gloss maps, this is because to make them you take the original texture and put it through some filters, i cant do this for the Near Future stuff as it has an all rights reserved license which does not allow redistribution of its textures (which is what i would be doing).

To get a similar-ish result try turning detail down and specular / metallic up. (fun fact: you can actually go all the way up to 999 if, instead of using the slider, you type it into the box to the right of the slider).

Got it. Thanks!

Link to comment
Share on other sites

13 hours ago, ZZetho said:

Blender is incredibly usefully, not just for finding out what meshes are what but also for finding what part of a texture is used where.

1. flip a texture vertically and save as a png.

2. open a model in blender.

3. delete all the unimportant stuff (colliders).

4. in the shading tab, import the png texture.

5. still in the shading tab, click on a mesh (this opens a bunch of nodes in the shader editor) and, in the _MainTex node, change its texture to the new one.

6. it should look wrong, this is expected.

7. go into the texture paint tab, you'll probably have to click on the + and go through a drop down menu  to get the option to open it.

8. you should now have a window where you can paint directly onto the model and a window that shows the texture you are painting. You can use this to find out what bits of the model use which bits of the texture.

I figured out, it wasnt that hard anyways! Thank you thank you very much! Now it can be much easier identifiying pieces, especially with complex models such as engines and docking ports :D

Link to comment
Share on other sites

2 hours ago, MrShelter said:

Uh is there a solution for this? For absolutely no reason, those 2 meshes are named the same yet use different textures, again is there a way to filter it out or it is game over?

Not that I know of, I've never seen something like this before.

Link to comment
Share on other sites

3 minutes ago, ZZetho said:

Not that I know of, I've never seen something like this before.

I might try using names from blender model, since they are unique (like one of them use .001, and other one doesn't), but I'm not sure if it will work

P.S. whoever did that please don't do it again, already two parts ruined :(

Link to comment
Share on other sites

15 hours ago, MrShelter said:

I might try using names from blender model, since they are unique (like one of them use .001, and other one doesn't), but I'm not sure if it will work

P.S. whoever did that please don't do it again, already two parts ruined :(

I have an idea:

I noticed they each have a slightly different shader specified, so I thought you could try including a 'shader = ░' for each respective material tab and see if that defines which mesh is which for TU

in other words the one without shielded in its materialName would have 'shader = KSP/Emissive/Bumped Specular' and its associated texture filepaths, the shielded one would have 'shader = KSP/Bumped Specular' and its associated filepaths

I'd put that one first in the material tab before all the meshes, and see if that works.   Not 100% it will but its worth a shot.

Link to comment
Share on other sites

3 hours ago, UncleMateo said:

I have an idea:

I noticed they each have a slightly different shader specified, so I thought you could try including a 'shader = ░' for each respective material tab and see if that defines which mesh is which for TU

in other words the one without shielded in its materialName would have 'shader = KSP/Emissive/Bumped Specular' and its associated texture filepaths, the shielded one would have 'shader = KSP/Bumped Specular' and its associated filepaths

I'd put that one first in the material tab before all the meshes, and see if that works.   Not 100% it will but its worth a shot.

Either I did it wrong, or it just didn't work

Based what I know of, shader = # is used in TextureSets, like this: 

KSP_TEXTURE_SET:NEEDS[TexturesUnlimited&Restock]
{
    name = Restock_Default
    title = Squad
    recolorable = false

    MATERIAL
    {
        mode = create
        
        shader = KSP/Emissive/Bumped Specular
    }
}

And used for the create material to signify what shader to use

Link to comment
Share on other sites

7 hours ago, MrShelter said:

Either I did it wrong, or it just didn't work

Based what I know of, shader = # is used in TextureSets, like this: 

KSP_TEXTURE_SET:NEEDS[TexturesUnlimited&Restock]
{
    name = Restock_Default
    title = Squad
    recolorable = false

    MATERIAL
    {
        mode = create
        
        shader = KSP/Emissive/Bumped Specular
    }
}

And used for the create material to signify what shader to use

Damn.  Well, worth a shot, anyway.  If I had a dollar for every harebrained workaround I've attempted and failed to employ making these configs, I could afford to buy KSP and all its expansions all over again, plus KSP2, Juno, and Kithack and have enough left over for breakfast, lunch, and dinner as well.

Link to comment
Share on other sites

2 minutes ago, UncleMateo said:

Damn.  Well, worth a shot, anyway.  If I had a dollar for every harebrained workaround I've attempted and failed to employ making these configs, I could afford to buy KSP and all its expansions all over again, plus KSP2, Juno, and Kithack and have enough left over for breakfast, lunch, and dinner as well.

Welp, that's sad, I hope users won't be mad. I can also open an issue on Restocked to rename the mesh, but I'm not sure if it gonna help

Link to comment
Share on other sites

57 minutes ago, ZZetho said:

@MrShelter@UncleMateo Have you considered making a dedicated thread for your recolour (or perhaps using @UncleMateo's existing thread)? It would help keep things organized, as opposed to being spread across multiple threads.

Sure I guess? I never created thread though, but I will try making one

Edit: here I created it, should be barebones: 

 

Edited by MrShelter
linkify
Link to comment
Share on other sites

@ZZetho Could you please update near future propulsion? I think it's corrupted. Whenever I use the recolors it's a solid red. I installed it correctly so this shouldn't be happening. I tried going into the mod folder to see the textures but they wouldn't load, so I think they're corrupt. I'm also having an issue where the NFaero parts are all metallic.

Link to comment
Share on other sites

2 hours ago, Davidinc2008 said:

I think it's corrupted.

It isn't corrupted, its just in the wrong format, i had the wrong release set as the latest one, reinstall and it will be fixed.

2 hours ago, Davidinc2008 said:

I'm also having an issue where the NFaero parts are all metallic

This is because of the same thing and also should be fixed.

1 hour ago, MrShelter said:

is it possible to make several "switches" under variant switch like you would to with KSPTextureSwitch, like it shows Appearance, smth2, smth3 in the SSTU Recolour GUI?

Not entirely sure what this means, if you mean having multiple variant selectors then no, parts can only have one.

Link to comment
Share on other sites

3 hours ago, ZZetho said:

I'm still not certain on exactly what you want to do but I don't think that is possible.

(stolen from TU thread)

MYBggLP.png

See the GUI at right corner? I meant the rows named Top, Body(red), and Bottom

They usually show up when you use several KSPTextureSwitch, but will the same happen with Variant Switch? As I know, it will just combine all of texturesets into one, using textureSet#, but is it possible to divide it into multiple?(like imagine combining two of them into one, and other to be left by itself, aka two rows now)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...