
At the moment, the algorithm works as follows: The inputs are any number of NURBS, which represent the shape of the aurora; a normal vector for each aurora, which represents the direction of the color spread; and a B-Spline of order 4, which represents the blending of different colors farther from the aurora's NURB-spline.
Basically, the idea is "for each pixel, cast a ray in the direction of each spline (meaning, reflect the spline's normal, and walk toward the spline. For each intersection, if the distance between the pixel and the spline is less than some arbitrary maximum distance, look up the appropriate color by computing the B-spine color interpolation for that aurora's color spline. Perform normalization as necessary, and color the pixel as the final normalized color."
One thing it does not handle particularly well at the moment is multiple auroras that collide. When they collide, the color mixing is not convincing at all. This is probably because I am counting the total intersections and dividing by that number. In reality, it doesn't work that way: we can't just do linear combinations of color.
Another consideration I have at the moment is that we have no antialiasing for the aurora, which we will need to look convincing. To my mind, this can be accomplished in one of two ways: first, we can send multiple rays that are slightly jittered, and average the color after; second, we can apply a Gaussian blur as a post-processing step. The former idea seems okay, but I have my reservations about it, since it will work well around the boundaries of the aurora's NURB-spline but it may cause bad blurring in the interior area of the aurora (since different rays will intersect the spline with different distances, which will result in mixing color from the color spline in ways that defeat the purpose of spline color interpolation). At the moment, I feel like a Guassian blur kernel, sensitively applied, would be the best solution.
No comments:
Post a Comment