guess you could also solve it via stencil buffer. If pixel does not change, clip it, otherwise write one (or something else) in there. You can then use the stencil buffer to mask out only the changed/unchanged pixels.
I decided to take a closer look at atmospheric scattering in my master thesis. I guess everyone who is interested in this kind of topic once stumbled over Bruneton's precomputed atmospheric scattering model (paper found here), as it is considered the most accurate and realistic scattering model to date. While the paper itself is really good, its a bit short and only introduces the general idea (as most papers do). Although, Bruneton provides the associated source code on his homepage, many people (including me) had problems understanding how it really works. I dont know how many hours (or even days) I was sitting in front of some equations trying to figure out what they are supposed to do.
Fortunately, many people on this forum helped me in understanding the code and therefore I want to give something back to the community by sharing my master thesis which is called "Deferred Rending of Planetary Terrains with Accurate Atmospheres". It can be found on my homepage (direct link can be found here).
In my thesis I was really trying to explain all the tricky parts of Bruneton's scattering model in an "easy" way and to create a document, I wished to have back then. I guess this is also the reason, why it reads almost like an tutorial, rather than an academic work.
In this way I want to thank again the community for helping me during my studies. I really hope my thesis will prove useful to many of you. Last but not least, some screenshots of my results (video can be found here)