Jump to content

Texture not showing up in-game no matter what


Recommended Posts

Hi,

So my problem is kinda weird.

After boring while of UV mapping the blender mesh, texturing it and finally importing it into Unity, after i apply the texture and the mesh collider, when i finally place the mod in the GameData folder, happens the unpredictable. No textures in-game. Just the plain old mesh crappy gray texture. It's getting kinda annoying over time. I've made a few parts before and the textures worked. Now it really looks like a mystery. I'm beginning to doubt blender. Although i've checked everything there, i'm left with no answers. I became so desperate, i came here. 

Could anyone help?

Thanks in advance.

Link to comment
Share on other sites

10 minutes ago, KerboNerd said:

Could anyone help?

Hi not a lot of detail to go on there, a pic of your unity scene and the inspector with the part tools applied would be helpful.  Questions..  do you have one texture per mesh? only one is supported.  Does the mesh show more than one renderer?  Does the texture show in unity? Have you accidentally applied the material (shader) to the collision mesh?  Whatever is wrong it's likely to be something easily rectified, usually is :)

 

Link to comment
Share on other sites

1 hour ago, SpannerMonkey(smce) said:

Hi not a lot of detail to go on there, a pic of your unity scene and the inspector with the part tools applied would be helpful.  Questions..  do you have one texture per mesh? only one is supported.  Does the mesh show more than one renderer?  Does the texture show in unity? Have you accidentally applied the material (shader) to the collision mesh?  Whatever is wrong it's likely to be something easily rectified, usually is :)

 

Anything else?

Link to comment
Share on other sites

2 hours ago, KerboNerd said:

This is the unity window:

Hi again, what happens when you click on the show materials button?  Ideally your file URL should point to a KSP GameData folder if part tools is to work properly, not desktop. Don't use MBM (nobody does anymore) it produces a massive file size even from a small texture sheet, use PNG instead .  Also give the part a name instead of Model, it'll make it a lot easier to manage (nothing worse than 200 files all called model) 

Can you show a pic of your scene with the mesh highlighted and visible in the inspector window.  According to your images the  hpconvert is the mesh and the convertorPart is the collider?  in the second image it looks as though the texture is applied to convertor part?

Its all a guess as we all do things a little differently, and for a simple cylinder shape  like that I'd just have the GameObject ( renamed to hpconvert) as a child of that would be the mesh hpconvert, there's no need for a separate collider as the unity applied convex mesh collider will work for that

EDIT just noticed that the scene view is set incorrectly , you have selected Center and Local, It should be PIVOT and Local, huge difference between the two when it comes to engines cockpits etc

EDIT 2  Just noticed that you are using Unity 2018.3.4 , the correct version for part tools and KSP modding is Unity 2017.1.3p1

 

Edited by SpannerMonkey(smce)
Link to comment
Share on other sites

17 minutes ago, SpannerMonkey(smce) said:

Hi again, what happens when you click on the show materials button?  Ideally your file URL should point to a KSP GameData folder if part tools is to work properly, not desktop. Don't use MBM (nobody does anymore) it produces a massive file size even from a small texture sheet, use PNG instead .  Also give the part a name instead of Model, it'll make it a lot easier to manage (nothing worse than 200 files all called model) 

Can you show a pic of your scene with the mesh highlighted and visible in the inspector window.  According to your images the  hpconvert is the mesh and the convertorPart is the collider?  in the second image it looks as though the texture is applied to convertor part?

Its all a guess as we all do things a little differently, and for a simple cylinder shape  like that I'd just have the GameObject ( renamed to hpconvert) as a child of that would be the mesh hpconvert, there's no need for a separate collider as the unity applied convex mesh collider will work for that

This is shown when "Show materials" is enabled:

http://prntscr.com/mk57qo

When i write the file with the PNG textures, do i need to target the texture file via the config file or it's already in the file

This is a similar project. I just chose a simpler cylinder.

http://prntscr.com/mk5ekq

Edited by KerboNerd
Link to comment
Share on other sites

1 hour ago, SpannerMonkey(smce) said:

EDIT 2  Just noticed that you are using Unity 2018.3.4 , the correct version for part tools and KSP modding is Unity 2017.1.3p1

 

1 hour ago, KerboNerd said:

This is shown when "Show materials" is enabled:

confused now, as it's not the same model or meshes as before, one fix at a time please :)

 

Link to comment
Share on other sites

1 hour ago, SpannerMonkey(smce) said:

 

confused now, as it's not the same model or meshes as before, one fix at a time please :)

 

It's basically the same thing cuz it happens with every model that i make.

In these pics i made the changes you suggested. I set the file url to the mod folder in GameData, made one game object of which i made a child object - the mesh. Applied the collider to it. Handle position to pivot/local. Now i'm beginning to worry my PartTools are incorrect. I had to redownload them once cuz i lost them. Maybe i messed up upon importing them.

Here are all of the pics that should resemble the problem:

http://prntscr.com/mk6iy5

http://prntscr.com/mk6j19

http://prntscr.com/mk6j7s

http://prntscr.com/mk6jk8

http://prntscr.com/mk6k2i

EDIT   I really think, the problem lies in a simple thing that would fix the textures for all of my meshes. So basically it doesn't matter what mesh i'm showing cause the process i go through is the same. Until i fix the problem, of course.

EDITTTT   Also will try installing your suggested Unity version. 

EDIT AFTER INSTALLING SUGGESTED UNITY  The problem still presists. I don't understand PNG. Do you need to add a texture line in the config?

Edited by KerboNerd
Link to comment
Share on other sites

5 hours ago, KerboNerd said:

I don't understand PNG. Do you need to add a texture line in the config?

Nope it is selectable in the same place as you have selected MBM.

In this image https://prnt.sc/mk5ekq

in the inspector mesh renderer box click the little arrow next to the bold Materials text, it should show your assigned material  something like https://i.imgur.com/HAvDGrZ.png

 

Link to comment
Share on other sites

8 hours ago, SpannerMonkey(smce) said:

Nope it is selectable in the same place as you have selected MBM.

In this image https://prnt.sc/mk5ekq

in the inspector mesh renderer box click the little arrow next to the bold Materials text, it should show your assigned material  something like https://i.imgur.com/HAvDGrZ.png

 

This is what it shows

http://prntscr.com/mkf50l

Does this matter by any means?

http://prntscr.com/mkf6jx

Edited by KerboNerd
Link to comment
Share on other sites

8 hours ago, KerboNerd said:

This is what it shows

That looks fine although you should remove that unused animator component

9 hours ago, KerboNerd said:

Does this matter by any means?

Nope that's as it should be, the default collider material will be more than adequate for your project, Physic materials are  a way of altering the games response to your part, you can, if required, make the collider appear hard, soft , bouncy, slippy and whole load of other combinations.

It's really difficult to tell whats wrong from these keyhole views of your project and aside  from stepping through the whole process one step at a time i can't see a solution.  As i've not already asked, do you  have any warnings showing at the bottom of the unity scene or in the console?

Have you tried creating a new material in unity, rather than using the imported material?  It's worth trying at this point (even though the assignment looks ok)  Create a new material and drag drop it either directly onto the mesh or into the material slot in the inspector,  re assign the shader ( use KSP specular as diffuse is horribly flat with zero reflectivity and you want a bit of shine) reassign the texture,  It's worth checking that materials are actually assigned in the renderer window,  on the part tools section of the inspector, select show textures then select compile textures and export, hopefully it'll work. 

One more or two more things, really obvious, i should have asked much earlier,  open the .Mu in a text editor, scroll down to the very bottom, you should see your texture name, should look something like this https://i.imgur.com/A2vvnud.png 

Finally the most obvious question of all, have you searched the KSP.log for your part and checked if the game can't find your texture or any other problem?  If you aren't familiar with reading logs post a link and I'll take a look. 
 

Link to comment
Share on other sites

1 hour ago, SpannerMonkey(smce) said:

That looks fine although you should remove that unused animator component

Nope that's as it should be, the default collider material will be more than adequate for your project, Physic materials are  a way of altering the games response to your part, you can, if required, make the collider appear hard, soft , bouncy, slippy and whole load of other combinations.

It's really difficult to tell whats wrong from these keyhole views of your project and aside  from stepping through the whole process one step at a time i can't see a solution.  As i've not already asked, do you  have any warnings showing at the bottom of the unity scene or in the console?

Have you tried creating a new material in unity, rather than using the imported material?  It's worth trying at this point (even though the assignment looks ok)  Create a new material and drag drop it either directly onto the mesh or into the material slot in the inspector,  re assign the shader ( use KSP specular as diffuse is horribly flat with zero reflectivity and you want a bit of shine) reassign the texture,  It's worth checking that materials are actually assigned in the renderer window,  on the part tools section of the inspector, select show textures then select compile textures and export, hopefully it'll work. 

One more or two more things, really obvious, i should have asked much earlier,  open the .Mu in a text editor, scroll down to the very bottom, you should see your texture name, should look something like this https://i.imgur.com/A2vvnud.png 

Finally the most obvious question of all, have you searched the KSP.log for your part and checked if the game can't find your texture or any other problem?  If you aren't familiar with reading logs post a link and I'll take a look. 
 

There are no error showing anywhere in Unity. At this point, i'm beginning to think that the problem is in blender. Maybe my UV mapping technique is unsupported?

Tried creating the new material, nothing happened.

This is what my .MU file shows:

http://prntscr.com/mkpfi5

Where can i fing the Log for the part?

 

Link to comment
Share on other sites

Omg.... I'm legit a r33**rd.

So turns out i had the ActiveTextureManagement mod installed. AS IT TURNS OUT it SOMEHOW deletes the textures from my created parts no matter how hard i try!

This has to be heard. If anyone struggles with this, PLEASE check if you have that mod or not :D

And SpannerMoney... I'm so terribly sorry for waste of your time.

Link to comment
Share on other sites

Just now, KerboNerd said:

This is what my .MU file shows: 

Where can i fing the Log for the part?

Well  that's odd, it clearly shows the texture has been applied to the model and was exported, I doubt very much if it's anything at all to do with your uv mapping technique ,  as I could show you some real horrors that work quite well in game. 

The log you need is the KSP.log found in the main KSP folder, I'm guessing that it'll show  a texture not found error for texture 3.png.  I have to check at this point your file structure,  It is KSP/GameData/Yourmod/yourmodParts/ and the texture Mu and cfg are altogether in the same folder?  

Link to comment
Share on other sites

13 minutes ago, SpannerMonkey(smce) said:

Well  that's odd, it clearly shows the texture has been applied to the model and was exported, I doubt very much if it's anything at all to do with your uv mapping technique ,  as I could show you some real horrors that work quite well in game. 

The log you need is the KSP.log found in the main KSP folder, I'm guessing that it'll show  a texture not found error for texture 3.png.  I have to check at this point your file structure,  It is KSP/GameData/Yourmod/yourmodParts/ and the texture Mu and cfg are altogether in the same folder?  

Weeeeeeeeee :)

http://prntscr.com/mkpt3f

Link to comment
Share on other sites

28 minutes ago, KerboNerd said:

Weeeeeeeeee :)

Congratulations  :)
(Tip I think your model has inherited some blender oddness, you may be able to get a more consistent finish by clearing any smoothing applied in blender (automagically or otherwise) and use the Unity version, once imported to unity select the import so it shows in the inspector,  the top half of the inspector contains various settings and the lower and image of the model. By default the Normals and Tangents options will be set to import and calculate,  change the Normals option to calculate, and observe the change in appearance, if you like it click apply and re export, I think you'll like it :) )

Link to comment
Share on other sites

1 minute ago, SpannerMonkey(smce) said:

Congratulations  :)
(Tip I think your model has inherited some blender oddness, you may be able to get a more consistent finish by clearing any smoothing applied in blender (automagically or otherwise) and use the Unity version, once imported to unity select the import so it shows in the inspector,  the top half of the inspector contains various settings and the lower and image of the model. By default the Normals and Tangents options will be set to import and calculate,  change the Normals option to calculate, and observe the change in appearance, if you like it click apply and re export, I think you'll like it :) )

Thanks for the tips!

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