Added gitignore
Compute light state and time before it changes.