Sparkly but not too sparkly! Anti-aliasing a procedural sparkle effect

We recently worked on a snow sparkle effect for a AAA console title. Due to a number of practical considerations we implemented a procedural grid based sparkle, which intersects the snow surface with a jittered 3D grid of sparkle shapes. While this worked well for simple scenes and depth ranges, it took a thorough analysis and some deep thinking to make it robust and suitable for use in production. In particular aliasing was a significant issue and required specific treatment to ensure the frequency content was suitable at every pixel independent of depth. In this talk we will illustrate the various sources of aliasing and present solutions for each case. The lines of thought that led us to our final solution are general in nature and are likely to apply to other procedural shader effects. The end result of our work is an anti-aliased, stable sparkle over the entire range of depths. The artists could comfortably drive down the sparkle size to the order of ~1 pixel without worrying about noisy flickering or other aliasing problems.