I used an emulator and saved it while kyogre was approaching me. I didn't know if it's shininess was determined before it approached me or when the battle started. Thank you :з
Shininess is decided when you start the battle.
It is most likely determined right as you enter the battle however it could be that if you see its sprite as a shiny but I'm not entirely sure.
P.S. you shouldn't ask emulator questions.