Assign a variation of a material (not two different materials) to different faces

As shown in the attached image, I want the material shader to use the output of ColorRamp1 for one set of faces (the notched faces at the edge of the box) and the output of ColorRamp2 for the other set of faces (the flat faces of the box), based on some form of Face ID, used via the factor for the Mix shader.

Since both faces are part of the same object, Object ID does not work.
And since I am using only 1 material, Material ID does not help.

I don’t want to use two separate materials for the different faces of this box, because for most part the desired material is identical, with some variation added due to the ColorRamps.

Any help is appreciated.


The typical, robust way to do this is make a black-and-white texture for the model to indicate where you want to use one ramp and where you want to use the other ramp.

Unwrap to a new UV layout, how it looks doesn’t matter. Put faces belonging to one material to the left side and the others to the right side. Separate output XYZ (X) and a simple math node greater than 0.5 to drive the factor. Could easily be expanded to drive four materials using four quadrants, 6 sides of a cube with more effort, or any kind of divisions with elaborate effort.