Surface-induced photorefractivity in twistable nematics: toward the all-optical control of gain