2
$\begingroup$

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: Normal shader

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: My attempt

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.

$\endgroup$
2
$\begingroup$

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

enter image description here

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:

enter image description here

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)

enter image description here

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:

enter image description here

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

enter image description here

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:

enter image description here

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.

$\endgroup$
  • $\begingroup$ 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. $\endgroup$ – TLousky Sep 8 '15 at 21:07
  • $\begingroup$ 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 $\endgroup$ – TLousky Sep 8 '15 at 21:21
4
$\begingroup$

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

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

$\endgroup$

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.