I implemented Rayleigh and Mie scattering for a game engine once (my own, hobbyist thing). It was pretty crazy to see a quite good sunset/sunrise cycle from those alone. IIRC even the sun itself popped out of that somehow.
I was using XNA (Microsoft's C# gamedev platform) and following Riemer's excellent series of tutorials, which have been preserved here[0], but I don't see anything about scattering. I might have gotten that bit from somewhere else. I do recall reading papers with math equations.
[0] https://github.com/SimonDarksideJ/XNAGameStudio/wiki/Riemers...