Jump to content

Parts sharing same textures. How do I get multiple parts to use 1 texture?


CoffeeSE

Recommended Posts

I have multiple parts that uses the same texture, and instead of having 3 sets of the same textures taking up space, is there a way for me to somehow "link" the texture path of multiple .mu file to a certain location in GameData? So that way I only have to have one set of textures for multiple parts in KSP. Thanks in advance!

Wait, wait, nevermind, forget this. I figured it out. How do I delete this?

Edited by CoffeeSE
Link to comment
Share on other sites

Care to share how you do it? ^_^

It's easy enough to do. You can either have them in the same directory and just use MODEL{model = } to define the .mu that's used, or you can reference textures in other folders.

For example, this nicks the textures from the Squad folders

MODEL
{
model = SXT/Parts/NERVA/model
texture = model000 , Squad/Parts/Engine/nuclearEngine/model000
texture = model001_NRM , Squad/Parts/Engine/nuclearEngine/model001
texture = model002 , Squad/Parts/Engine/nuclearEngine/model002
texture = fairing , Squad/Parts/Engine/nuclearEngine/model003
scale = .66 , .66 , .66
}

I've seen it done without having a placeholder texture file in the folder, but I've never managed to get that to work (I just use a 1x1 texture). Could be to do with people writing the texture as .mbm, haven't tested that though.

Link to comment
Share on other sites

i kinda figured it out, as i posted somewhere else:

i initially had trouble getting texture overloading to work. but then i just did the following:

1. in unity every material that is shared should have the same name across all models.

2. export all models that share a texture to one directory (the texture and all models that use it should be in that directory)

3. do not try to overload the textures in the cfg, i could never get that to work. this leaves me to believe that a system is being worked on, but is still too buggy for showtime.

you cant use a chair texture from one url and a panel texture from another. but you can group several parts into a single texture atlas. this is in effect the same as just using more smaller textures of smaller resolution. for example, i got 4 wing parts into one 512^2 texture, which means i could have just done 4x 256^2 textures. but it worked out because i wanted seamless uv mapping, and doing this with a long object like a wing wastes a lot of space (unless you break it up and create a bunch of seams). of course in this way i still have space for another delta wing and another control surface, since i am a really efficient uv mapper.

the first commandment of uv mapping:

thou shalt not waste texels.

Link to comment
Share on other sites

Care to share how you do it? ^_^

name your parts and their respective .cfg files anything you want.

in the .cfg file, put:

MODEL

{

model = CoffeeIndustries/Parts/Structural/planeFuselageSys/p1_fuseNormal

}

scale = 1

rescaleFactor = 1.118

with the "model =" path leading to where the .mu part it references is and what it's named. i put my scale and rescale factors outside, but i think you can put them within the brackets.

for example in my "planeFuselageSys" folder, I have two .mbm texture files named:

planeFuselageNormal.mbm

planeFuselageNormalN_NRM.mbm

and my parts different .mu parts:

p1_fuseNormal.mu

p2_fuseUnder.mu

p3_fuseUpper.mu

p4_fuseTail.mu

and etc. you get the idea. all of these use the same two .mbm files. I.e. all four of the parts in Unity uses the same .png textures from photoshop. And they all export the same .mbm files. So by doing this, you'll get rid of duplicate textures and free up a lot of space.

Link to comment
Share on other sites

Coffee, does this mean that your mod will less space? I must consider redownloading...

Yes it will take less space (errr...for the same number of parts as in previous version), approximately more than 50% less space, with better textures too, and more parts! Check the mod page as I post the progress of stuff there! :)

Link to comment
Share on other sites

  • 2 years later...

In my case, i have multiple parts using the same textures, but all parts are using 3 textures, one for RGB, other for Normal and other for emissive.

And i wanna but all parts in their correct folder, like crew parts will be in parts/crew, all fuel tanks will be in parts/fuel, and etc. And all textures will be in Textures.

Is that possible , and how?

Link to comment
Share on other sites

On 12/16/2016 at 10:37 PM, Climberfx said:

In my case, i have multiple parts using the same textures, but all parts are using 3 textures, one for RGB, other for Normal and other for emissive.

And i wanna but all parts in their correct folder, like crew parts will be in parts/crew, all fuel tanks will be in parts/fuel, and etc. And all textures will be in Textures.

Is that possible , and how?

You can reference multiple textures even for multiple materials in one part like I did for my antenna:

MODEL
{
	model = Coatl Aerospace/ProbesPlus/Assets/Antenna/dish_deploy_S2
	texture = antenna_a_D, Coatl Aerospace/ProbesPlus/Assets/Antenna/antenna_a_D
	texture = swis_mesh, Coatl Aerospace/ProbesPlus/Assets/swis_mesh
}

Model = [Name and directory of the mesh object/mu file]

Texture = [Texture name], [Texture file location]  NOTE: If the texture is not located in the same folder as the mesh, you must include a dummy texture of the same name in the mesh's directory. You just need a 1-4px square depending on whether you use a TGA, PNG, or DDS.

Hope this helps.

 

Link to comment
Share on other sites

1 hour ago, akron said:

You can reference multiple textures even for multiple materials in one part like I did for my antenna:


MODEL
{
	model = Coatl Aerospace/ProbesPlus/Assets/Antenna/dish_deploy_S2
	texture = antenna_a_D, Coatl Aerospace/ProbesPlus/Assets/Antenna/antenna_a_D
	texture = swis_mesh, Coatl Aerospace/ProbesPlus/Assets/swis_mesh
}

Model = [Name and directory of the mesh object/mu file]

Texture = [Texture name], [Texture file location]  NOTE: If the texture is not located in the same folder as the mesh, you must include a dummy texture of the same name in the mesh's directory. You just need a 1-4px square depending on whether you use a TGA, PNG, or DDS.

Hope this helps.

 

Yeah, i already saw that solution, but the part where i need to create a dummy texture not give me joy. So preferred to change all parts to the same folder for now!

Thank you anyway!

Edited by Climberfx
Link to comment
Share on other sites

13 minutes ago, Climberfx said:

Yeah, i already saw that solution, but the part where i need to create a dummy texture not give me joy. so preferred to change all parts to the same folder for now!

It's not hard actually. If you want, you can grab the empty texture I have in my mod. It'll save you from redoing your folders

Link to comment
Share on other sites

4 minutes ago, akron said:

It's not hard actually. If you want, you can grab the empty texture I have in my mod. It'll save you from redoing your folders

I know, is not about the difficulty, but the necessity to have an empty file on each folder to that work.

In my mind that should work without that. Only redirecting the texture to the correct place.

So, in protest, i prefer to use same folder for all textures.

I can change idea in the future.

Edited by Climberfx
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

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...