Simulating synchrotron radiation in accelerators including diffuse and specular reflections