Add serialize methods to lights and rays