An electronic device can utilize one or more sensors and/or imaging elements to determine the relative position of at least one light source relative to the device. In various embodiments, occlusions can be used to cause shadows to be cast on certain sensors. By determining the relative position of each occlusion relative to the sensor, the device can determine an approximate direction of the light source. Utilizing the relative position of a light source, the electronic device can properly light or shade a graphical object to be rendered by the device or otherwise process image information captured by the device.