1. A method implemented by a computer for creating a three-dimensional mask model, the method comprising: simulating the effect of light passing through a mask using three-dimensional mask topography information to produce a theoretical image; determining initial filtering kernels for a three-dimensional mask model using the theoretical image; and modifying the initial filtering kernels until a total difference between the theoretical image and a simulated image is minimized or below a predetermined threshold to produce final filtering kernels, wherein the final filtering kernels are configured to be convolved with one or more mask transmission functions to produce a near-field image, and wherein the simulating, determining and modifying steps are implemented using the computer.