Estimating light direction
Google provides us with a robust solution for estimating the amount of light in an AR scene with ARCore. As we learned, light direction is an equally important part of scene lighting. Google didn't intentionally ignore estimating light direction with ARCore; it's just that that problem is really difficult to do right. However, Google did provide us with just enough tools in ARCore to be able to estimate light direction, providing some simple assumptions. First, we need to assume that our user, for now anyway, will remain in the same room or area. Second, our user will need to look in at least an 180 degree arc across their vision, or more simply put, the user just needs to look around. Third, it works best if the real-world environment is lit from a distant single bright source, such as the sun. Based on those assumptions, we can simply store the direction the user saw the brightest image in and use that to reverse calculate our light direction. This may sound...