Creating MatCap Shader in Unity
A MatCap shader (short for "Material Capture" shader) is a type of shading technique often used in 3D graphics to apply a predefined material or surface appearance to a 3D object. This technique is popular because it allows artists to quickly give objects a complex, polished look without needing advanced lighting calculations.
Here is an example of MatCap shader in Unity (ShaderGraph)
The shader is relatively straightforward, mapping the bitmap onto the mesh according to the camera's view direction and the object's surface normals. This approach is similar to a billboard shader but also considers the mesh's shape. This effect is particularly effective when used with unlit shaders.
Here is an example of MatCap shader in Unity (ShaderGraph)
The shader is relatively straightforward, mapping the bitmap onto the mesh according to the camera's view direction and the object's surface normals. This approach is similar to a billboard shader but also considers the mesh's shape. This effect is particularly effective when used with unlit shaders.
This shader works well on shiny materials such as: metals, liquids, glass, gems, car-pain finish, toon (anime) etc.
Notice how this shader works much better on more detailed mesh. As you can see the bunny has a good representation of a golden material, whereas the cube is not shaded as well (even though they share the same material! ).
This shader allows for a great artistic control, as you can see the detail of the bitmap is preserved well! However, the MatCap shader utilises a variation of "baked lighting" and does not represent real time shading by default!
Notice how this shader works much better on more detailed mesh. As you can see the bunny has a good representation of a golden material, whereas the cube is not shaded as well (even though they share the same material! ).
This shader allows for a great artistic control, as you can see the detail of the bitmap is preserved well! However, the MatCap shader utilises a variation of "baked lighting" and does not represent real time shading by default!
MatCap Shader with transparency
Naturally MatCap shaders works extremely well to depict translusent objects such as: ice, glass, bubbles etc.
Here is an implementation of a MatCap shader featuring an alpha transparency channel. Ensure your Surface Type is set to Transparent for optimal results. This effect offers significant potential while maintaining computational efficiency.
Here is an implementation of a MatCap shader featuring an alpha transparency channel. Ensure your Surface Type is set to Transparent for optimal results. This effect offers significant potential while maintaining computational efficiency.
Here are few more examples, feel free to download the bitmaps and use it in your projects!
[ Images are 2048x2048 ]
[ Images are 2048x2048 ]
A notable example of this effect can be seen in Super Mario Odyssey, where Gold Mario appears to utilize a similar shading technique. Often employed as a default material in 3D modeling software, this shader provides a quick and efficient way to add depth and realism to objects.
▼ Download all files! [ 2 shaders & 6 bitmaps ]
▼ Download all files! [ 2 shaders & 6 bitmaps ]
How to create your own texture for a MatCap shader
When creating a MatCap texture, it's essential to utilize the entire bitmap area, as demonstrated in the example below. It is also possible to use a square gradient that will cover the entire bitmap. When creating a bitmap texture for a Matcap shader, it is intuitive to draw a spherical shape to represent the full range of lighting conditions. By mapping the desired colors and gradients onto this sphere, you can effectively simulate how light interacts with the surface of a 3D object from various angles.