# Cycles normal shader with colors similar to baked normals

I'm trying to render my object's normals with colors that are similar to those you get when baking normals (or the matcap normals material), i.e. the color distribution that characterizes normal maps.

Example for what I'm looking for:

I tried using the normal pass in cycles or BI, and tried using the geometry --> normal input node in cycles or BI, but the closest I could get is this:

I also tried to play with the colors via a Hue/saturation node, but couldn't really reconstruct what I'm looking for.

Would appreciate ideas for reproducing this kind of a shader.

True Normal vector does not take in account smooth shading. Use Normal vector instead.

By examining the matcap, we can say that we are already not too far away from the result. The colours in the corners of the matcap are:

Blue Violet Yellow Green


While in the preview we see:

 Black Red Violet Green


Viewed from the top, Suzanne looks this way:

Colors ar much more similar to the normal matcap, which is in someway related with the coordinates of a sphere's point viewed from top (with a bit of easing)

Coming back to Suzanne, by rotating the Texture coordinates of -90° you'll easily get the colors from the top to be tranferred to the front:

Than by tweaking the values you may obtain a simlar result (or even better)

But this kind of shader will looks good only from one side: the front. Normal maps are in fact made to be viewed from one side only...it just a plain texture.

If the camera change its position, something must be elaborate to take in account the changing of the view point and re-elaborate the coordinates of the shaders. This can be done with the node setup you can find in this Blenderartist thread about creating a matcap shader in Cycles.

I'll report the nodetree in the image below:

The image texture is containing a pic of normal matcap mirrorball. In your case, the Transform vector output can also be used (after tweaking saturation and values) without the need of an external image.

This shader will look like a normal matcap from every point of view.

• Thanks! Shame there's no way to get this to work without using an external texture. At least I had to give up after lots of attempts. But this works nicely and will definitely do, thanks again. – TLousky Sep 8 '15 at 21:07
• BTW, the closest I've come yet is using the geometry input node and a value of 1/3 in the location fields of the texture mapping node. Still not exactly it though: pasteall.org/pic/show.php?id=92873 – TLousky Sep 8 '15 at 21:21

Here is node setup to generate normal map shader in cycles without using matcap:

I tested it in Substance designer and it seems to work great.