A device and a head-mounted display (HMD) are provided. The device comprises a first flexible electrode and a second flexible electrode configured to provide a driving voltage to the device; a birefringent material layer coupled to the first flexible electrode and the second flexible electrode, and structurally patterned to provide at least one predetermined optical function of the device; and a first photo-alignment (PAM) layer and a second PAM layer sandwiching the birefringent material layer. A structured pattern of the birefringent material layer is based on a manipulation of optic axis of birefringent material molecules in the birefringent material layer.