This patterned layer could include structures such as spacers and walls, dimensioned and positioned to ensure that the resulting optical cavity has the desired dimensions to satisfy various constraints, such as with appropriate grading as shown in FIG. 10 or other desired inhomogeneity.