Normal Map displaying weirdly

So I’ve imported a Normal Map along with other texture files into UE4 for my model. But when I create the material for the mesh, my normal map looks really blue, even though the imported texture isn’t. I’ve attached a screenshot. I don’t actually know if it affects the actual way the normal map works, but this has occurred across a few of my meshes. The meshes were drawn in Blender 2.8. Thanks for any help in advance! :slight_smile:

300646-capture.png

You can see the normal map in the texture sample on the top right is wayyyy too blue compared to the texture file in the bottom left.

The normal map seen in bottom left doesn’t look like it’s using either UE’s or Blender’s coordinates.
Could you tell me how do you bake (and with what settings) and what file format do you input as? I’d also like to see the texture’s properties inside UE.

P.S. This is a wrong category to post in.

That is not a UV map texture, and when sampling a normal you must use the normal sampler type, or the colour space will be interpolated incorrectly.

Yes by baking I mean Cycles for example (iirc Eevee can’t bake to external textures, but I might be wrong). What are your XYZ coordinates when baking? There is something really wrong as the ”empty” space does not look like a flat object-space normal (0.5, 0.5, 1). Also when saving an image, Blender uses colour space specified in scene settings (eg standard, film, sRGB etc), make sure it’s set to standard and without manipulations. In this screenshot you’ve collapsed the texture settings-menu, could I see that?

And this would go into materials / shaders / rendering, as blueprints refer to the code / script made in the Blueprints-environment. As for file formats, PNG is just fine. I use TGA myself but it doesn’t make a difference in this case.

EDIT: I’m not quite sure I correctly understood how you derived the normals for the bake process but it could be that recursively baking normals could screw up if in some part you don’t sample already baked normals inside Blender as Linear or Non-Colour Data, or don’t specify them as normal maps and instead plug them straight into a normal input etc.

EDIT 2: Not relevant for OP but a tip for improving texture baking: your normal maps are contained within the UV islands which will cause issues with sampling, Blender has an option to deal with this by stretching island edges into free unused UV-space - you should always do that.

That’s a UVmap, not a normal I think… Also, if it were a normal, you don’t have to select anything special in the sampler type, default should be fine.

The way I made this normal map was I actually had individual meshes (that were already baked on their own as individual meshes) which I made into a modular set which I then used to build houses out of. Then I unwrapped all the individual meshes into a single separate uv, which i then baked the texture maps as diffuse using the previous textures as the “base colour” input

by bake settings, are you referring to like using Cycles?
and by file format are you referring to it being a PNG?

oops, where should I have posted it under? Thanks!

oh i didn’t realise, hmmm i didn’t change the option though, it was preselected

The baking process might actually be the cause of the issue as I baked it as a diffuse map afterwards when attempting to combine the different meshes together. I can’t think of a good way of explaining what I did. Basically:

  1. Create a few high poly meshes, such as wooden beams and roof tiles
  2. Create the low poly meshes, baked the normal maps
  3. Using the low poly meshes, I created an entire house
  4. Joined all the low poly meshes that form the house into one mesh and created a separate UV map for the new mesh (House)
  5. I then used baked the textures of the individual meshes onto a new texture map for the new UV, but in this process, I had to put everything into the Base Colour node (basically I put the albedo map of the individual low poly meshes into the base color, baked it and saved it, then did it with the roughness map, and also with the normal map, which might have actually caused this problem?)

With what you mentioned about stretching islands to free unused space, is there a name for this specific process I can search up for tutorials on?

Firstly here is the setup you should be using in your case. All individual properties are plugged into their respective inputs in a Principled BSDF. Make sure that your texture sampling settings are the same as here for each value (otherwise the data is going to get skewed and it gets worse the more steps you have)

300679-what-to-bake.png

Secondly when baking, you instead select a specific value you wish to bake. If this isn’t an option, make a shader where you plug the input into an emissive node, and bake Emit. It’s still not a recommended option, but will work perfectly fine in your case (Albedo, roughness, metallic etc (NOT for normals))

300680-bake-settings.png

When baking normals for use in Unreal Engine, make sure the Space and Swizzle is as seen in this screenshot. (Not for baking to be used inside Blender as it has different Swizzle. [Here’s a simple article on that.][4] Scroll down to the bottom to see coordinates for various software you might be using). Different programs have different ways of reading normal maps because the data is stored differently. Even if most normal maps look blue they probably aren’t cross-compatible.

You can also see the Margin-bit here, turn it up enough that it fills all the empty space. It won’t stretch the boundaries over the UV space that you actually use, but fills the empty space to make sure that when the texture is sampled etc that there is information for the visible texture on a mesh.

300691-colour-management.png

Finally before saving an image, make sure the scene’s colour management settings look like this.

Let me know if you still have issues :- )

I couldn’t make out every single node in your video because of the compression, but from what I saw, you did everything the right way. The normal map also looks correct inside UE when you previewed it - the R, G and B channels were inside a 0-1 range and aligned properly.

It’s okay that the normal map looks a bit off in the material editor because it shows you the relevant information to the engine, clamped to RGB, instead of showing you a human friendly sRGB representation. Does the finished material’s surface / normal look correct to you?

P.S. I saw that you turned up the margin a bit, but it’s better to do more. Here’s an article explaining it better than I did, and again it has a table of minimum margins depending on the texture’s base resolution to avoid broken compression. I tend to go way overboard because then there’s no downside and no room for error, and if I later decide to add bump offset or parallax occlusion mapping, or some animation to the UV’s, the margins keep the UV seams clean.

P.S.2. Your normal map looks like it’s not meant to be tiled but instead used as is. Your texture settings have it’s tiling set to Wrap which affects mipmapping and sampling, as when compressing the border pixels it will look on the opposite end of the texture. In your case, Clamp-tiling on both axis will fix it.

Hope this helps :- )

Thanks for helping so much but I still can’t get it to work :frowning: Here’s a link to a video of me following your steps but still producing the same result, blue normal map in UE4 material editor. Is there another possible explanation? - YouTube
(at the start i kinda meddled with my material for my low poly mesh but it shouldn’t affect anything right? since i’m just baking my from high poly to low poly onto a new texture anyway)

looking at this video, i notice that his normal map is also quite blue and it doesn’t seem like he’s pointing it out as an error

Im a bit late to answer here but since i had the same problem and this didnt actually solve my problem i decided to answer in case someone has the same problem in the future.

First i have to say that i can only image that you are using transparency on your texture when making the Normal map. I was doing a project right now and got this problem when making my normal map with my texture using transparency (no background on the texture). The texture looks all fine when outside of UE4, but when importing it UE4 messes things up.

I cant say 100% sure this was your problem but since it is the same than the one i had so i imagine is the same.

So the easy way to fix this is to just put a background color to your texture when making the normal map (black would be the best but if your texture has some black colors you can use other color to not mix with your texture). This will not only fix this blue lines when importing to UE4 but it will also make your Normal map stronger and better.