Rigorous 3D modeling of confocal microscopy on 2D surface topographies