An option may be to use Physical Material Masks. This post covers how it works (as it doesn’t appear properly documented):
It will probably depend how your material is structured how useful it can be (as in can it relate to a static look up). The usage basically resolves to the raycast hit mapping to the UVs of the mask and returning the index of the physical material.