Ray optics simulation