A seamless universe is important to the Pegwars experience, and that means procedural atmospheres you can see from outer-space all the way down to the ground.

The Pegwars atmosphere shader is drawn in screen-space, and composited over the screen using the depth information from both near and far depth textures.  The shader itself simulates Rayleigh and Mie Scattering by ray tracing through and integrating against the atmosphere volume, taking into account the air density at any point based on altitude and what's in the depth buffers, the relevant ratios of gases and particulates, as well as other procedural variables.

As well as drawing to the screen, the atmosphere is also drawn into the near cube-map for reflections, ambient lighting and the all-important SSDO.  This way objects fit in the scene nicely, no matter what planet you are flying around.


  1. This is most amazing thing that I ever seen (all right, one of most amazing :)

    Dude, please don't try to make it 100% photo-realistic. I don't mean the shader itself, but the common graphical style. Now it has a style and this style is really special. Would be great to keep it the same IMHO.

    Good luck and enjoyment from the process of creating this masterpiece. Subscribed to your RSS.


Post a Comment

Popular posts from this blog

2022 Screenshot Update

Screenshot Progress Update!

Rendering Nebulae