How to Create Cavity Textures in Photoshop?

Most websites that offer PBR textures do not include cavity textures. But what if you want to use them? Where can you get them? In this tutorial, we’ll explore how to create cavity maps in Photoshop. You can also use GIMP as a free alternative; the same principles apply there as well.

Lazy Loaded Image

Your advertisement can be placed here for $200 permanently. Suggested resolutions: 1800x663 or 1400x1400. Contact us.

1. Cavity, AO and Curvature Texture (Optional Read)

If you’re not interested in theory, you can skip this section (Section 1) and its subsections, but I highly recommend at least skimming through it. So, why would you want to use cavity textures in the first place?

Cavity textures are excellent for enhancing realism by adding subtle/micro-details to areas that would naturally have more shadow or dirt buildup. Like ambient occlusion (AO), cavity textures are grayscale maps, where darker areas indicate deeper cavities and lighter areas represent raised or flat surfaces. But wait — how is a cavity texture different from ambient occlusion?

1.1 What differentiates a cavity map from an AO map?

  • A cavity map focuses on smaller details, and is not dependent on lighting, whereas AO is directly influenced by it to simulate ‘fake lighting’ so to speak. AO is all about larger areas.
  • AO answers the question: “How would light behave on the surface of this mesh?” By creating AO maps, we can inform a game engine or render engines where light is less likely to reach, so we can create ‘fake’ soft shadows in corners, creases, and areas where surfaces are close together. AO maps provide a subtle shadow effect across the model, showing how light naturally diminishes in tight spaces.
  • Cavity maps address the question of: Which fine details (such as small crevices, grooves, and indentations on the surface) should be emphasized? In some cases, it also answers the question: Which areas (where dirt, grime, or wear might accumulate in the tiniest areas) need to be highlighted?
  • Cavities are simply higher-frequency geometric details. For example, think of pores and wrinkles. From an AO texture, you’d expect to see shadows in places that would actually get occluded, such as the inside of the mouth, nostrils, ears, and eye sockets. Cavity maps, on the other hand, focus on finer details rather than shadows.
  • AO maps take into account the distance between nearby objects and calculate occlusion based on that distance. Cavity maps, on the other hand, do not consider the proximity of objects; instead, they focus on the detailed surface features regardless of their proximity.

I believe the points outlined here should make the differences clear. However, if you have any questions, feel free to contact me.

1.2 What’s a curvature texture?

Curvature textures highlight the inward and outward curves of a model to simulate effects such as wear and tear, edge highlights, and dirt accumulation. The main difference between a curvature texture and a cavity texture is that curvature textures emphasize the overall shape of the geometry, showing where the surface curves outward or inward. This can be useful for simulating effects like edge wear or highlighting details at the edges. In contrast, cavity textures primarily focus on fine details within the surface, emphasizing small crevices, grooves, and indentations. However, cavity maps can also be used to enhance geometrical changes around the edges of a mesh.

2. Tutorial Begins

Launch Photoshop, import your normal map texture, and create two new empty layers:

Lazy Loaded Image

Name Layer 3 as ‘Red Channel’ and Layer 2 as ‘Green Channel’.

Then select your normal texture layer, and switch to ‘Channels’ mode. Click on the red channel, press ‘Ctrl + A’ to select everything, and ‘Ctrl + V’ to paste it into the respective layers we just renamed. Set the blending mode to ‘Overlay’:

Lazy Loaded Image

    Apply the ‘Emboss’ filter to the red channel layer:

  • Angle: 0
  • Height: 3 to 5 (Or adjust according to your texture.)
  • Amount: 100%
Lazy Loaded Image

    Then apply the ‘Emboss’ filter to the green channel layer:

  • Angle: 90
  • Height: 3 to 5 (Or adjust according to your texture.)
  • Amount: 100%

Merge the red and green channel layers:

Lazy Loaded Image

Now, what we have here is a curvature texture. To adjust this texture and convert it into a cavity map, we can add a ‘Levels’ adjustment node and tweak it until the finer details become visible. The key point is that it should resemble an AO map while capturing the finer details we are aiming for.

Lazy Loaded Image

And that’s it! If you enjoyed this tutorial and would like to see more text-based tutorials, you can support me on Patreon. In return, you’ll receive a bunch of goodies that you can use in your projects!