I'd like to render a normal map for an entire scene (for a large background for an isometric game). I tried exporting the "Normal" pass of my render layer, but it's not quite right. Here's what I get from a cylinder:


For comparison, here's more what I (not to mention the game engine) was expecting:

enter image description here

I've seen tutorials on normal maps, but they are all about baking one object's geometry onto a simplified model. Is there an easy way to render a normal map for an entire scene, to line up with the standard combined render?

  • 1
    $\begingroup$ Guessing from the colors, your actual result might be in object space, but what you want is tangent space. $\endgroup$ – CodeManX Jul 14 '14 at 12:52
  • $\begingroup$ The normal pass is VERY different from what you would get by baking normal maps. $\endgroup$ – GiantCowFilms Jul 14 '14 at 16:46
  • $\begingroup$ @CoDEmanX I thought it was something like that, but I don't think I want tangent space, because then wouldn't anything due to geometry rather than material appear flat? $\endgroup$ – andyvn22 Jul 14 '14 at 18:10
  • $\begingroup$ It would appear flat where the low poly object and the highpoly object have the same tangent, but the details where the high poly object is different will show up. $\endgroup$ – gandalf3 Jul 14 '14 at 20:51
  • $\begingroup$ But in this case there is no low-poly object. $\endgroup$ – andyvn22 Jul 15 '14 at 2:22

Got it! As I thought, Blender's normal pass contains exactly the right data, but it's not in the right format. From a video intending to use the normal pass in After Effects' "Normality" plugin, I found that it's easy to convert Blender's colors to the standard colors using the node editor: Normal Fix (This node setup is for Blender Render, not Cycles. For a Cycles solution see this answer.)

|improve this answer|||||
  • 2
    $\begingroup$ In current versions (I'm using 2.71) of Blender, the rendered normal map colours will still not be correct. This is because the image will most likely have gamma correction applied to it (yes, even the normals) and will look too light. To fix this, open the 'Scene' tab in the properties pane and change 'Render' in the Color Management dropdown to 'Raw'. $\endgroup$ – MrFlamey Aug 27 '14 at 6:37
  • 2
    $\begingroup$ In addition, if you are doing this with Cycles, you don't need the invert node for some reason. However, blender internal render is MUCH faster if you only need the normal. $\endgroup$ – MrFlamey Aug 27 '14 at 7:26
  • $\begingroup$ I agree that one looks more correct than the green-red one, but how do you quantatively say it is indeed correct? I am trying to recover the normal vectors from the normal map and not sure if I am going that correctly. $\endgroup$ – Sibbs Gambling Oct 8 '16 at 16:01
  • 1
    $\begingroup$ @SibbsGambling: It's definitely a bit of a guess, but given how correct it looks (everything looks perfect to my eye in all my tests that use these normals) and the not-too-magic numbers that appear in the node editor, I'd wager it's spot on. If you're having trouble reading the vectors, you could start with a known-correct example texture & normal map from a website if you're worried that your Blender work is the issue. $\endgroup$ – andyvn22 Oct 9 '16 at 11:52
  • $\begingroup$ @SibbsGambling You can compare your results to the normal Matcap. If the colors are the same as when viewed through that Matcap, they’re correct. $\endgroup$ – Mentalist Jan 16 '18 at 15:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.