I've created a displacement map which is based on the height of the mesh. The problem is that by the nature of this organic texture there is some self-intersecting geometry. I don't believe this can be avoided in this case, but I need to remove the resulting dark areas from the render because they will create unrealistically deep pits in the displacement. If I can do this at the rendering stage it will save a lot of time in the image post-processing stage, and produce more consistent and accurate results.
Dark spots in the cracks = bad.
I tried isolating back-facing geometry and treating it the same as front-facing. This made no difference though, so it must be something about the layering of the geometry rather than the facing angle. I didn't expect to have such trouble with a simple height map gradient, but the overlapping geometry has turned out to be a challenge.
Any help appreciated.