1. A method implemented by a computer for creating a three-dimensional mask model, the method comprising: identifying features to include in a mask for which the three-dimensional mask model is to be created; simulating the effect of light passing through the mask having the identified features using three-dimensional mask topography information to produce a theoretical image; determining initial filtering kernels for the 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 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.