1
$\begingroup$

I wonder how I can render camera-view invariant surface Normal maps in Blender (ideally, through Blender's Python API)? Maybe as the first step, can someone explain how one can obtain surface Normals? My goal is actually to get surface Normal maps that are not dependent on the camera angle. How can I do that?

I have tried two methods but cannot get the kind of results I expect: 1- I can only see the surface Normal maps by pressing N and then clicking on Matcap and selecting the Normal ball as shown below. But I cannot use this method to get renderings.

enter image description here

2- I followed what @Bruno's suggested in his response too. Although the rendering problem seems to be solved, but I still am not able to get camera view-invariant renderings of surface Normal maps as can be seen below:

enter image description here enter image description here

And here you can find the corresponding .blend file.

$\endgroup$
  • $\begingroup$ Are you trying to bake normal maps from a high poly to a low poly model? $\endgroup$ – Craig D Jones Feb 21 '18 at 2:13
  • $\begingroup$ @CraigDJones Sorry I'm a little bit confused. As far as I know my problem has nothing to do with the number of vertices used for each face. I just want to render a surface Normal map of a 3D shape. That 3D shape could have many faces (say a couple of thousands). For your information, the faces have 3 vertices (triangle faces). Also, what I want has nothing to do with lighting condition as explained here. Does that help? $\endgroup$ – Amir Feb 21 '18 at 2:21
  • $\begingroup$ The Matcap is just for visualization, but if you bake from the model to a lower resolution one that encapsulates the original, and have an UV mapped image set to bake to, then you can bake out a normal map that can then be used similarly to the page you show. $\endgroup$ – Craig D Jones Feb 21 '18 at 2:27
  • $\begingroup$ @CraigDJones Sorry but almost all of the things that you said seem new to me. Could you please post an answer if you know how this should be done practically? Python code is appreciate more. $\endgroup$ – Amir Feb 21 '18 at 2:42
  • $\begingroup$ This could be of some use to solving your problem: blender.stackexchange.com/questions/39528/… $\endgroup$ – masterj2001 Feb 21 '18 at 3:23
1
$\begingroup$

This seems to work only in Cycles, not Blender Internal.

Simply enable Normal pass in your render layer. That'll produce the "invariant" normal map along side the combined rendering. enter image description here

$\endgroup$
  • $\begingroup$ I updated my question. Could you please check it out again? $\endgroup$ – Amir Feb 21 '18 at 3:12
  • $\begingroup$ I checked my simple model and it IS invariant when I rotate the camera around. May be there's something wrong with your setup. Are you rotating the camera or the model in the screenshot shown? Can you share your Blender file? $\endgroup$ – Bruno Feb 21 '18 at 3:58
  • $\begingroup$ I updated the question and uploaded the .blend file. Could you please take a look? $\endgroup$ – Amir Feb 21 '18 at 15:40
  • $\begingroup$ A quick look at the blend file confirma what you're seeing... not sure what's happening yet. I'll take another look later $\endgroup$ – Bruno Feb 22 '18 at 7:04
  • $\begingroup$ I noticed you are using Blender Internal renderer in your scene. Using Cycles instead and the Normal Pass in the render layer and it seems to produce the proper invariant normal map you are looking for. $\endgroup$ – Bruno Feb 22 '18 at 13:27

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.