Comets
Idea
I’m experimented a lot with asteroid style for Astrus. In one of these experiments i added trail to bodies. Trail turned out very bright, so i got an idea to make comets and meteors.
Graphics
Shader
There are 2 shaders: body and gas trail.
For body i used already written shader for stars. The most of the time, theese bodies will be very bright to see this shader. Shader is very simple - just a few animated layers of voronoi and gradient noise.
Trail shader is more interesting.
First, i stretch coordinates for noise and add time to X axis.
Second, i create mask with trail-like shape
And finally, combine noise and mask. Lerp between raw mask and mask with noise will increase trail density
Other
Slightly volumetric 2D lighting and lens flare will accent brightness of theese objects.
Lens flare color does not modulate with 2D lighting. I wrote a simple script to support this.
Movement
Comets have hightly eccentric elliptical orbits. My previous article is about them.
Gas trail (shader) are always turned away from star. Dust trail (particles) are slightly rotated.
When near star, comets heating up and start emitting trails. Ice and particles lits by sun, so the closer comet to star the brighter it will be. In reality, comets not THAT bright, but it’s looks cool.