Jump to content

Normal/Bump map not working in Unity for KSP | Help with KSP mods (Unity/KSP PartTools)


Kion

Recommended Posts

Hey KSP nerds! Im getting back for KSP modeling for just a few days, and i was wondering why does my normal map looks very weird?

I have no idea what is happening, but i have the most recent version of Part tools, and unity.

It looks fine in blender, but then in unity looks weird...

Blender:

image.png?ex=67b76c87&is=67b61b07&hm=e68dd4bc797b208d66993d611746df227a44e9eeaf7b9e03bc1f1f630e7ad2fe&

In Unity:

image.png?ex=67b76c87&is=67b61b07&hm=ef5c9be5d60769f881405cf877d74d8e05f5a38be5296cfa3e7a287d16efd328&

Here is the normal map:

normal_map.png?ex=67b76d1e&is=67b61b9e&hm=94ad425748c070cf82feb02c64a99c6c553c6bd6df9eac37a55f64088b45f21b&

I'm also getting this weird bug when i click on my part, the select color is not like the normal parts...

112123231312.jpg?ex=67b76f35&is=67b61db5&hm=e0d3b723fafe7a28a6ba8b519d42c8e6d3750f04ece67c6886eddee34646bad6&

Do note that i used the "bump specular" material preset in unity

image.png?ex=67b770b1&is=67b61f31&hm=683967dde8e243b02b41c739298ba2e3ee1308818a6ea3c24417d6f95435f0bd&

I'm also getting this message in Unity, have no idea if its related, but since it includes "material" in the message, thought it might be worth sharing as well.

image.png?ex=67b76c87&is=67b61b07&hm=bc7ed5cbe891e59080c39595bdc73b2e0a84c63d95062e7ff2c64c5958f63399&

 

Can anyone help me? Please, Thanks! :)

Edited by Kion
Link to comment
Share on other sites

UPDATE!

I think i fixed it, and let me know what you think.

Ok, let's start.

When creating a new image texture in Blender, (for baking the normal map for external use, like for Unity), you have an option to enabled "32 bit float", which presumably "creates an image with 32-bit floating-point bit depth" (Maybe I should google it, but after googling it 2 times, the only thing that it said, was that it takes more time to load, and the file size is a bit bigger, which makes more sense if you think about how 32 bit works).

image.png?ex=67b77bd5&is=67b62a55&hm=03398f82c35fd4cc2ed9b73e67d9d1ed1c9f85126f2e794e9ea45276c155134a&=

I created a new model with a basic texture just to see if it worked (although I ran into another problem of the texture being weird, but if I'm gonna be honest, it did not matter).

Problem is probably with the base color or the node setup, and not with the "32 bit float" part of it.

image.png?ex=67b784c1&is=67b63341&hm=06a0d761a7f0415503e7147e951b4d610e8ae87380ba4035626b8e676a49a98e&=

As I was saying, I created a new model which I intended to test to see if the "32 bit float" thing was the bug or not.

I baked 2 maps. The first one was a normal one (without the option enabled), and the second was the one with the option "32 bit float" enabled.

When testing, it seemed that the model that had the "32 bit float" option enabled, (when clicking on the part) don't look as it should, and the one that didn't have the "32 bit float" option looked as it should.

The model with the option "32 bit float" enabled:

image.png?ex=67b77e59&is=67b62cd9&hm=408c14e560d0697ae10674a1915428f0cb61f7120c7cf30446358d8dfea79a88&=

image.png?ex=67b77eb1&is=67b62d31&hm=9b15fd8523b615363e00a15db7cc65e7f8926e68f5aab05b260844db5ff53e7c&=

The model without the option "32 bit float" enabled:

image.png?ex=67b77e5a&is=67b62cda&hm=bc0c5d01688c555ed30b22f9bcf13a193eca2b9d2330618353025fe915b57757&=

image.png?ex=67b77eb0&is=67b62d30&hm=5e47f652eac61030d58122de0f7eb46ff089b607c790d5f507d29531ddfd7f7a&=

In summery, the "32 bit float" option when baking a texture in Blender might be good for other things like for other 3d software, but I found out that when testing it in KSP against another model that has the same texture but baked on a image texture without the option enabled, the one without the "32 bit float" option enabled looked like it should.

My initial thought of this was that it must have been something to do with the "Bump" or "Bump Specular" shaders used in the PartTools Unity package used to export the parts for the game,  but for all of my KSP mods, I have been always just using the "diffuse" shader until I found out that I was missing the very cool detail. The "diffuse" shader is basically just the base color, and not the base color and the normal/bump map. Since, it must have been something with the normal/bump map it self, and not with the shaders, since I presume I have everything up-to-date and correctly installed in  the Unity and PartTools side of things.

image.png?ex=67b78017&is=67b62e97&hm=ca912719ebd78c03cc346c8e67c51e70be131ccfe2e33b5f929d957a3e525c39&=

Also I don't know if this has anything to due with the model not looking as it should in the game, but I noticed that in Unity the model with the normal map with the "32 bit float" option enabled, is slightly darker than the one without the "32 bit float" option enabled. In addition, when looking at the normal maps themselves, the one with the "32 bit float" option enabled is a bit more pink than the more purple one, which might indicate why it's looking weird in game, let me know what you think.

The model with the option "32 bit float" enabled:

image.png?ex=67b780b2&is=67b62f32&hm=47afc8aaa3ccf397ed5f9081a2ab509633943c5b4bde650011eef0c8c50dbd71&=

The model without the option "32 bit float" enabled:

image.png?ex=67b780a2&is=67b62f22&hm=a5224ded47bc675624383f6deab2ae3d0fe9478ce3da967a49ce55544ca42f02&=

And if you want to take a closer look at the maps themselves, here they are:

Base color:

test_color.png?ex=67b781a7&is=67b63027&hm=e216cc19f459ef2ce13ed3886cfddbe00de9b6f29d9cddfc8f43c8bc55bf08ae&=&format=webp&quality=lossless&width=676&height=676

Normal map without the "32 bit float" option enabled:

test_normal.png?ex=67b781a7&is=67b63027&hm=686831dd148ddcfb60f1b5bb0c9f2e35d25fbdd6ceb3c398f5978aa70ac8ec24&=&format=webp&quality=lossless&width=676&height=676

Normal map with the "32 bit float" option enabled:

test_normal_2.png?ex=67b781a7&is=67b63027&hm=a438927c1d1886a50f5091350de6d437a8a0d30fd4155d12700c38eda05034ca&=&format=webp&quality=lossless&width=676&height=676

I have no idea if it has to doe with PartTools, or it's shaders for KSP, Unity, or anything else, but I will try again with the original model to see if this is the case. Follow this post/thread to stay up-to-date.

Edited by Kion
Link to comment
Share on other sites

FINAL UPDATE

So after all it was the "32 bit float" option when baking the texture in Blender that was the issue. It worked with the original part, so I think it's fixed.

Let be know if you have experienced this issue before, and let me know if you found the same way to fixing it as I did.

How it looks in KSP:

image.png?ex=67b78adc&is=67b6395c&hm=de7f6d3c0dba53c4359258e75dfa1a71ac7032c06f57d7b06b756932a1eb0171&=image.png?ex=67b78add&is=67b6395d&hm=8a9e1f572189ef84d2c5ad95e08332bd483beb8bba22ab82594b8a8ccb5b4577&=

How it looks in Unity:

image.png?ex=67b78add&is=67b6395d&hm=198804daf1a15035631e8a37c151596440b566f0131ebbb4ee2aa010fcb115cd&=

Anyways, well,  at least I hope this forum thread/post will help others fixing this same issue.

So in summery: The problem is fixed, and yes it was the "32 bit float" option thing when baking the texture in Blender that was the cause of this problem.

Hope you learned anything from this thread and thanks for reading!

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