Ensuring uniform illuminance in waveguide-based augmented reality (AR) display devices is crucial for providing an immersive and comfortable visual experience. However, there is a lack of a straightforward and efficient design method available to achieve illuminance uniformity over the full field of view. To address this issue, we propose a novel design that utilizes random mask gratings (RMGs) as the folding grating and the out-coupling grating. Unlike traditional approaches that modify the grating structure, we control the diffraction efficiency distribution by adjusting the filling factor of the mask while keeping the grating structure unchanged in one RMG. The grating structures are designed and optimized based on rigorous coupled wave analysis and particle swarm optimization. The feasibility of our method is verified by the simulation results in Lighttools. In the FOV range of 20°×15°, the eyebox uniformities of all fields are greater than 0.78, which can provide a good visual experience for users.