Using Custom Matcaps in Blender

What is a Matcap?

A matcap, short for "material capture," is a quick and performant way to fake a material appearance on an object using only a texture. Matcaps are commonly used for lookdev in graphics software and in video games and other real-time rendering to fake metallic or reflective materials and maintain performance—but they're also incredibly useful for more artistic NPR (non-photorealistic rendering) workflows, as seen in my Red Shoes and Rainbow Dragon models.

This guide details how to map a pre-made matcap texture in a material for Cycles and EEVEE using the Shader Editor.

The full node tree from this tutorial is also included in my Modular Matcaps Pack with additional mapping features, 26 pre-made matcap textures, and a set of over 50 modular matcap components to create a broad array of variations and add a unique touch to your renders with ease.

How to Map a Matcap

In short, we'll need to effectively create a custom UV projection mapping for our matcap texture using the object's normals, then we can further tweak and manipulate that as needed.

1. Rotate Object Normals towards the Camera

Add a "Geometry" or "Texture Coordinates" node to get the object's normals, and attach it to a "Vector Transform" node. Set it to "Normal" and transform from world normals to "Camera." (Note: you might choose object normals for some scenarios, but I recommend world for most.)

1a. Plug In Your Matcap Texture

Now let's plug in our matcap texture to see how it looks.

2. Convert Vector Space to Normal Space

As you can see, it's a bit wrong. A proper UV map only uses the X and Y (red and green) values and only from a range of 0 to 1. This is called normal space, but as you might have noticed in step 1's image, it is currently still in vector space—a range from -1 to 1.

To fix it, let's add a "Vector Math" node, set it to "Multiply Add," multiply it by 0.5, then add 0.5. (Technically, you only need to do this to the X and Y values.)

3. Adjust for Perspective

Now it almost looks finished! But depending on your matcap, you might notice that it looks a bit wrong and distorted towards the edges of your viewport—plus it doesn't move when panning the camera around, which looks rather odd compared to a real metallic or reflective material.

That's because the camera transform we did earlier doesn't account for perspective. It's not pointed towards the camera; only towards a hypothetically endless plane that constitutes the orthographic direction of the camera.

To fix it, we'll add a "Vector Rotate" node between the first two steps, set it to "Euler" rotation mode, and then we'll perform some magic to calculate the rotation, seen below.

Here, we're getting the view vector (the direction our camera is facing) from the "Camera Data" node, flipping its X and Y values, and inverting the former (X). (Y1 = -X; X1 = Y) Now our matcap looks correct no matter where it sits in the viewport!

4. Bonus Tweaks

But why stop there? Now we can make our matcap mapping node more customizable.

How to Scale and Rotate

Simply add a "Mapping" node between Steps 2 and 3 to easily fine-tune the scale, rotation, and position of the matcap.

Using a Custom Normal Map

To use a custom normal map with the matcap, just drop in your normal map texture, connect it to a "Normal Map" node, and use that in pace of the object's default normals we used in Step 1. Just connect it to the same "Vector Transform" node as before.