Jump to content

How to add Normal maps and regular diffuse "painting"


Recommended Posts

Ok, I've been putzing around and made a few parts with just a painted texture and gotten them to work (mostly).  Now I'd like to be able to do some normal mapping and add it to the diffuse (or other) "painting" on a part.  I've searched high and low, read numerous posts, watched numerous videos, but none seem to show how to actually combine the two. 

I've figured out how to actually create the normal map (through the NVIDIA tools in Photoshop) and can add the normal map to a part I create (using Blender), but it results in just a part that has no colors, just a textured surface.  I can also get the "painted" surface all the way into the game itself, but it's just painted with no texture.

I've read/seen somewhere that two parts are needed - the one on which you intend to have the diffuse (or other) "painting", and a low-poly copy on which you create the normal map.  Is this correct?  And if it is, how do you UV map them both from the same scene in Blender?  I've created an object (a cube), duplicated it in-scene and tried separately UV unwrapping them both only to have Blender put both UVs on the same .png file no matter what I try to prevent it.

I've even tried making two UV maps (one regular, one the 'normal' map) of the same object but cannot figure out how (in Blender again) to assign both UV maps to the same object. 

Or do you need to create two separate UV maps in Blender (one that you would paint as usual and the other a normal-mapped copy) and then somehow combine them in Unity?

Or is it something completely different (and knowing my tendency to over-complicate things, probably much simpler)?

I would appreciate any help you can offer - even just pointing me to a good video or post is acceptable.  Thanks in advance for your help!

ZD

Link to comment
Share on other sites

You don't need two parts, at least not in the game.

It sounds like what you need to do is set the material you use in Unity to something that uses a normal map instead of just diffuse. I don't recall exact name but it will be something like "bumped".  That material accepts two textures, one is your diffuse and the other will be your normal map.

It's important to import the normal map graphic the correct way into Unity. Again, instead of importing it as a texture you will want to import it as a normal map.

I'm away from my PC or I could give more specific details. Maybe this is enough to get you down the right path.

Link to comment
Share on other sites

New to this too so may be off base here but the standard KSP shader in Unity KSP/Diffuse only has a spot for the texture - if you chose a different shader (not sure which one - try one with Bumped in it as Kurld suggested) you may see two spots for textures- one the color and the other the normals. I think the normal needs to be in a different format too - DXT5nm? The positioning of the bumps should use the same UV mapping as the texture.

Link to comment
Share on other sites

Ok, that's the first I've heard of a different format for a normal map.  Does anyone else have any information on this?  I ran out of time last evening and wasn't able to work in Unity to see if there were options there.

ZD 

Link to comment
Share on other sites

6 hours ago, ZuluDoggy said:

Ok, that's the first I've heard of a different format for a normal map.  Does anyone else have any information on this?  I ran out of time last evening and wasn't able to work in Unity to see if there were options there.

ZD 

 

2 hours ago, Kurld said:

I think unity converts it automatically, as long as you tell unity the graphic you are importing is a normal map.

I created a short tutorial with screenshots on imgur.

I never got the unity grayscale converter to do anything for me, but it might be your problem.

First, if your bumpmap image is set to something like "texture" or "Sprite" in unity, set it to normal map. At that point unity will assume you want it to do the conversion; I've never gotten it to work well, and it won't work at all with a premade map. When using a premade map make sure you uncheck "generate from grayscale". After that it's as has been stated above: KSP has a whole mess of shaders that mix and match support for various attributes, with KSP diffuse supporting only diffuse. In this case you want (from the KSP material list under the shade drop-down) Emissive/Bumped Specular.

Why you can't have a bumped Emissive that isn't Specular is beyond me, given you can have one that isn't Emissive or Specular, but sliding the specularity slider down gets you the same results. On the same coin, I'm not sure why any more than one all-supporting material is necessary. Perhaps it's an optimisation thing.

Link to comment
Share on other sites

7 hours ago, Kurld said:

I think unity converts it automatically, as long as you tell unity the graphic you are importing is a normal map.

I created a short tutorial with screenshots on imgur.

Thanks - makes it easy to see what you were doing.  I'll give it a shot in a little bit.

4 hours ago, Balto-the-Wolf-Dog said:

 

I never got the unity grayscale converter to do anything for me, but it might be your problem.

While I could make grayscale heightmaps in Photoshop, most everything I've read said a normal map (bluish-purple) is the way to go.  Sounds like there might be a reason for that.

ZD

Link to comment
Share on other sites

24 minutes ago, ZuluDoggy said:

Thanks - makes it easy to see what you were doing.  I'll give it a shot in a little bit.

While I could make grayscale heightmaps in Photoshop, most everything I've read said a normal map (bluish-purple) is the way to go.  Sounds like there might be a reason for that.

ZD

Normal maps are always bluescale, if that's the proper terminology. The shades determine "topology" as far as the lighting engine is concerned, and contain information not only about height but also angle. You definitely want one of those. I use an online normal map generator personally as I haven't had much luck with unity's. The point is when you designate your map as a normal map in unity, unity will assume you want it to build a blue map from a grayscale image unless you uncheck "generate from grayscale", which is checked by default. Letting unity try to generate a normal map from something that is already a normal map will result (probably) in nothing usable. I had a problem very similar to yours when I was getting started, and got hung up in two places: the first was trying to hand paint a simple normal bluescale (which is basically impossible), and the second was failing to designate a proper map as a normal map and uncheck the grayscale box.

When you click on your normal map texture in unity, the drop-down menu should specify "normal map", as opposed to "texture" or "Sprite", and "generate from grayscale" should be off, since the normal map is already a blue map.

 

Edit: that imgur series tutorial does a better job of explaining it than I do. Just follow that and you should be good. Normal maps are kind of arcane, but they're easy to produce and use.

Edited by Balto-the-Wolf-Dog
Link to comment
Share on other sites

@ZuluDoggy Unity Convert-From-Grayscale is fine as a preview, but produces issues in game. use a 3rd party program like xNormal to convert your grayscale bump maps to height maps before exporting to the game. Compare the base texture and the NRM texture in this dropbox link, that's what you're looking for to start with. I just use modified layers from my diffuse to create the bump map effects.

https://www.dropbox.com/sh/agf0oo98yo8g121/AADhZuxNXBu1JKhQt0lEoDo4a?dl=0

Link to comment
Share on other sites

why create a greyscale then try to convert it to purple?

if you have a high and low poly model in blender, you can create directly the normal map (purple) from the high poly, easier faster better.

Link to comment
Share on other sites

On 7/7/2017 at 0:47 PM, Skalou said:

why create a greyscale then try to convert it to purple?

if you have a high and low poly model in blender, you can create directly the normal map (purple) from the high poly, easier faster better.

Personally, I like just texturing the normal details rather than having to do a bunch more modeling. But I'm really comfortable with thinking in terms of (black<>white) = height.

Link to comment
Share on other sites

So what am I doing wrong here?  Here are my uv map and normal map: http://i.imgur.com/nUakwxY.jpg (uv)   http://i.imgur.com/4RamvGF.jpg  (normal)

Here is the normal map imported to Unity (note unchecked 'convert from grayscale'): http://i.imgur.com/r78sgYN.jpg

Here are the 2 assigned to the box in Unity, the second as a Bump Map (my only choice in any of the KSP bumped categories): http://i.imgur.com/kyM3MBz.jpg

And finally, the resulting box immediately before exporting.  No surface variations whatsoever.  http://i.imgur.com/VXu4gw3.jpg

I've tried making normal maps in both Photoshop and Gimp, I've used both Blender and Wings3D to do the modeling, I'm using Unity v5.4.5, and I'm using the "PartTools_AssestBundles" found somewhere on these boards.

I admit it, I'm out of ideas.

 

ZD

 

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