0
$\begingroup$

After many hours of searching, trying and scratching my head I turn to you guys. Seems like many other have this same problem but haven't seen any solution to this yet.

I am rendering cars in blender and I do most of my post work in Photoshop. To do this I need a "correct" render of the normals and I just can't achieve this in Blender.

This is a ref image of what I am looking for and this Normal render is from 3Ds or Cinema 4D (I think).

I use this Normal to color range select parts of the car facing a certain way.

enter image description here

$\endgroup$
  • 1
    $\begingroup$ World or camera space normals? (Btw, this sounds like an XY Problem and I would answer with a partial frame challenge). $\endgroup$ – Leander Nov 5 at 10:05
1
$\begingroup$

This can be done with the workbench engine, if you don't need motion blur as shown in your example image and the colors don't have to be 100% accurate. For accurate results you will have to create a material for Cycles and Eevee.


Approach 1: Workbench Engine

Example render

  1. Switch to the Workbench engine

Workbench engine

  1. Enable MatCap as material and select the normal map matcap.

MatCap

  1. Enable Transparent for the Film

enter image description here

  1. Set the View Transform to Standard

Set the view transform


Approach 2: Material for Cycles and Eevee

Render

If you need accurate results, then you have to create a material for Cycles and Eevee that transforms the object's normals into camera space and uses them as a color for the object. This can be accomplished by transforming the Normal output of the Geometry node, which gives the normal in world space, into camera space with the Vector Transform node. In order to get the proper colors you will have to adjust the output though, since the camera normals have the following ranges:

$$ x: [-1.0, 1.0]\\ y: [-1.0, 1.0]\\z:[-1.0,0.0]$$

Colors have to be in a $[0.0,1.0]$ range, therefore the vector has to be multiplied with $[0.5, 0.5, -0.5]$ componentwise and then shifted by $[0.5, 0.5, 0.5]$. The node setup is depicted in the following image. Note that the emission shader is only visible from the camera and therefore doesn't impact other objects in the scene.

Node setup

Make sure to either save the result as OpenEXR or set the View Transform to Raw to get the exact pixel values.


The result produced with the second approach is more accurate, since it calculates the normals properly instead of performing a look up in the matcap bitmap. The material doesn't have to be assigned to every object individually if you use material override as @RobinBetts mentioned.

Material override

$\endgroup$
  • 1
    $\begingroup$ Your edit read my mind. BTW, do you know? Is the 'Normal' setting of the Vector Transform node just the normalized 'Vector' setting? it's not very well documented .. BTW BTW.. I suppose you could make a pass with a material override .. $\endgroup$ – Robin Betts Nov 5 at 12:33
  • 1
    $\begingroup$ Yes the Normal option normalizes the value. It's not needed here since the input is already normalized. $\endgroup$ – Robert Gützkow Nov 5 at 12:38
  • $\begingroup$ THANKS @rjg This is exactly what I was going for! The material setup work awesome. I was afraid I would get banding when selecting colors but I didn't. Thanks again! $\endgroup$ – gubbfet Nov 5 at 12:44
  • $\begingroup$ @gubbfet Great! If my answer solved your problem, please mark it as accepted by clicking on the checkmark. $\endgroup$ – Robert Gützkow Nov 5 at 12:46

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.