Photolithography has been widely implemented with a photomask in contact or in close proximity to the photoresist layer. The flatness of the substrates is a crucial factor to guarantee the quality of the entire patterned photoresist (PR) layer especially for large-area photolithography. However, some substrates, such as sapphire wafers, do not possess highly uniform thickness as silicon wafer does. In this work, we demonstrate that a flexible polydimethylsiloxane (PDMS) photomask with optical total-internal-reflection structure can effectively circumvent this problem for mass production. Different from conventional photomask that the light is blocked by the patterned reflective/absorbing materials, the distributions of light intensity on the PR is engineered by the geometric structure of the transparent PDMS photomask. We demonstrate that 4 in. patterned sapphire wafers can be successfully fabricated by using this PDMS photomask, which can be easily integrated into the present techniques in industry for mass production of substrates for GaN-based optoelectronic devices.