6
$\begingroup$

I am wondering if there is any way that we can alter the cycle normal pass to output value in camera space. Currently, as far as I know, the normal is in object/world space, which does not change when the camera is moving around.

I have tried using matcap, but the result is undesired. Matcap coasts a new material on the objects and overrides its transparency (eg. leaves will appear as just a rectangle)

UPDATED: The interest render engine is Cycle, and as far as I know, in Blender Internal, the normal pass is already in camera space. That could be a solution, render the scene twice, one with Cycle and the other with Blender Internal. However, it is not desired since the overhead would be too much.

$\endgroup$
3
  • $\begingroup$ Which render engine? In cycles you can use the camera view vector or maybe an osl script could produce what you want. $\endgroup$
    – sambler
    Commented Dec 19, 2016 at 9:31
  • $\begingroup$ I forgot to mention, it's Cycle. I reckon that Blender Internal's normal pass is in camera space. But rendering 2 scenes (independently) is undesirable since it would double the time. $\endgroup$
    – AugLe
    Commented Dec 19, 2016 at 15:00
  • $\begingroup$ @sambler: could you please specify the answer? I can tranform the normal vector using node editor but only for material output, not for rendering (maybe I don't know how to do it). Besides, I have no experience with OSL script, maybe you could help me more? $\endgroup$
    – AugLe
    Commented Dec 19, 2016 at 15:07

1 Answer 1

3
$\begingroup$

This can be achieved using the Vector Transform node to transform the Normal from World coordinates into Camera coordinates to match the Blender Internal Normal result.

Use the following material :

convert normal to camera space

The key part is the Vector Transform node - this is set to transform the Normal from from World to Camera space. The remaining nodes perform some necessary conversion since BI appears to map camera space in opposite directions to Cycles - so the X and Y both need to be multiplied by -1 (Z is unaffected).

In order to apply the normals to the whole scene (to create a Normal 'pass') you can use the Render Layer Material Override setting to create a whole layer that renders all materials as this and include that pass in the compositor in place of the Normal.

As a comparison, this produces the following result :

Blender Internal : BI

Cycles : Cycles

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .