With the help of a guy on YouTube I managed to get a nice result, though my approach is mega-overkill for most situations I need a lot of control for fast iteration times, as I’m working for insanely high-level graphics. I can’t share my shader network because it’s for a commercial project but I can tell you roughly what I’m doing.
Basically the Atmosphere that extends off of the Earth is an additive material done with two spheres that have inverted face normals (so they point inside), and maps a gradient texture across it. The gradient aligns itself to the direction of the light source (easily done in my case because I always know where my sun is, but you can update a simple parameter via blueprint if you need to move it). Rather than use a texture in my example, I use a custom HLSL node that let’s me pick and modify a gradient of Vector4 parameters on the fly, the first 3 values define colour, while the last value defines it’s position on the gradient map. I do this to get a falloff to a warmer colour around the day/night boundary on the sphere. The HLSL node that generates the gradient based on UV’s can be found here. I use a function for it so I can have a varying amount of bands in said gradient. Using a Colour Look-Up-style gradient texture is cheaper, but you lose flexibility of colours.
I do this for two of these spheres to get a nicer effect, and also fade off the gradient at the outermost edges using a fresnel in the opacity slot, whose power is also affected by the planets radius (ObjectRadius Material Function).
The Earth-Surface is where it get’s more complicated. I first have a ‘band’ around the day/night area which also aligns itself to face the sun, and is used to map a orangey gradient around the edge. This is also masked by a fresnel node which has some low BaseReflection to allow it to glow more at the edges. Alongside this, I also have a second gradient which again is aligned to the sun direction, and lerps between a band of about 8 different colours to give the impression of light-scattering. Again this is multiplied by a Fresnel so it glows more at the edges, but I have a low falloff so it appears on the entire surface. I eventually mask that Fresnel by the day/night gradient so it doesn’t glow on the night side.
I’ve done other things in mine too, I have a green pollution-like layer on the night side which is done a similar way. Hope this helps a bit!
(The material network for the Earth Surface has gotten quite out of control, and doesn’t preview correctly in the material editor either.)
At some point, I’d quite like to implement JBaldwin’s Eclispe Shader, but I’m not quite sure how to go about it because of the way it’s created.