How to darken crevices/grooves/engravings I'm making 3D models of weathered gravestones with photogrammetry and using the textureless model with simulated shadows to read the engravings:

It works pretty well, but it's much more legible if I make the engravings black and the surface white and don't depend on shadows.  For some stones, I figured out I can do this in Blender by importing the .obj file, and making a shader that divides the world into white and black by coordinates, then very carefully rotating and shifting the model until the surface is in the white zone and the engravings are in the black zone:

This is tedious, and doesn't work at all if the stone isn't perfectly flat, like if it bulges out in the middle, etc.  You can see how the area around &quot;July&quot; is darker because it's not quite flat there:

How can I make only the engravings dark and the flat parts white, in a way that ignores broad curvature and doesn't require me to rotate it to a specific angle?  Is there some kind of &quot;color by local depth while ignoring global depth&quot; shader?  Or &quot;take the median position of the connected vertices within a certain radius and then shade based on Y depth relative to that median&quot;?  Or &quot;anything that can be touched by a 30 mm rolling ball is colored white and anything touched by a 5 mm rolling ball is colored gray and the rest is colored black&quot; except with continuous color variation vs ball size.
I mentioned Pointiness in the comments and you said you tried it; the thing with Pointiness is that it's a bit hard to handle so you really need to &quot;crush&quot; the value down in something like a Color Ramp.  In this image, both of the stones are exactly the same model, but on the right hand side is the node graph you see below.  Note how the words are visible on the right and invisible on the left?  I squeezed the pointiness values in on both sides of that Color Ramp:

This might not be the exact solution you want, as the bumpiness of the surface and the edges of the stone also show up in my example due to the pointiness, but if you tweak that color ramp you might get the result you're after.  You can also tweak the Mix node to make it more or less subtle.
You can also try the &quot;Advanced Pointiness&quot; from that link I shared in the comments above.  It gets rid of the spottedness and might be more what you're looking for:

Where I have that &quot;Noise&quot; texture that would be where you put your actual texture; I just did that to give the cube some kind of texture.  To adjust the darkness, you can change that -10 to anywhere in the range -10 to 10 based on how sharp you want the color.  0 would be gray and likely invisible.