Physically-Motivated Learning For Photorealistic Scene Reconstruction And Editing In The Wild