pairs of corresponding colours match. In comparison,
Knecht et al. (2011) do something similar by finding
tone mapping function for the rendered image.
In previous work we also find ways of handling
spatially and temporally varying scene illuminations.
Rohmer et al. (2014) does so with scene-mounted
cameras that stream the scene radiance as spherical
harmonics from a PC to the AR device.
There are other similar approaches in the liter-
ature, using either probes placed in the real scene
(Calian et al., 2013) or constructing virtual probes
from camera image feeds (Nowrouzezahrai et al.,
2011), using software like PTAM (Klein and Murray,
2009).
Rohmer et al. (2017) also show how to construct
3D point clouds with the help of a depth sensor, and
then from the point cloud inferring the environmental
illumination. Similarly, Sabbadin et al. (2019) creates
a 3D point cloud from a low dynamic range photo,
and after expanding it to high dynamic range, use it
for real-time lighting.
In contrast to these recent approaches, we use the
built-in cameras of the device, and the information
they have already calculated about the lighting condi-
tions in the scene, to update our lighting hierarchy in
real time. This approach allows for a real-time light-
ing acquistion and rendering system that achieves re-
alistic lighting in augmented reality devices that use
optical see-through displays.
3 ALGORITHM
Our proposed algorithm uses a quadtree, to keep track
of the locality of the data, in combination with six
vectors, to track directionality. The lighting data is
supplied by common camera parameters; we track
correlated colour temperature (CCT), as supplied by
the white balancing algorithm, and estimated lux val-
ues, which can be calculated from the set exposure
time and gain level of the image sensor. We also
store information about the brightest pixel values in
the camera’s image stream to expand the type of light
sources we can compensate, allowing for more ex-
tremely coloured light sources, not adhering to the
commonly used black-body radiator approximation.
3.1 Quadtree
At the start of the program execution a root node for
the quadtree is created at the location of the user. Each
node in the quadtree defines an axis-aligned boundary
box (or AABB) that defines a centre in a 2D plane and
a box size, and a data point that holds the directional
lighting information. The nodes also keep references
to their parent node and children nodes—a doubly-
linked tree structure. The root node is assigned a size
that should cover the whole scene. As the user tra-
verses the scene and new data is sent from the cam-
era, the cell where the user is standing is subdivided
into four new cells of equal size if there already is
data saved for the original cell (see Figure 1). There
is a minimum size at which the cells will no longer
subdivide. The minimum size can be arbitrarily set
and should be adapted for the scene. A typical value
would be the smallest distance between any two light
sources in the scene.
When data is saved in a node, the full chain of par-
ent nodes are updated with the same data. This is to
make sure that when a lookup occurs for cells that are
further away from the user, there will at least be rel-
evant data saved, instead of some default value. This
situation can typically happen with animated objects.
For example, in Figure 1, when the user reaches the
third sample point in I, and then spawn an animated
object that travels into E. There is no data saved in E,
but there is recent data saved in A from when I got
updated that can be used as an approximation.
A natural expansion of this would be to use an
octree to store lighting information in three dimen-
sions. As our goal was to implement a simple and
performant method, we opted for a two-dimensional
data structure, which should cover the common case
of a user wearing an AR device and walking around a
scene with varying lighting.
3.2 Triangular Bipyramid
So far we have not mentioned how the directional in-
formation of the camera parameters is saved within
each node in the quadtree. We want our cell data
to cover incoming light from several directions, but
at the same time account for that there may only be
sampled data for a few of them. This depends on to
where the user is turning with the head-mounted cam-
era. Since the algorithm is meant to run on a head-
mounted device, and not rely on a high-performance
computer, the probe has to be able to be constructed
and read-back easily. For this we decided to use a
six-sided representation where the six sides are dis-
tributed around a triangular base. This allows us to
have each direction cover 120°. Each node saves six
sets of the camera parameters. Each set represents a
different direction and can be thought of as the surface
normals of a triangular bipyramid. Figure 2 visual-
izes these normals vectors. This distribution of nor-
mal vectors gives us three sample directions pointing
up, where would expect to get more direct sampling
GRAPP 2024 - 19th International Conference on Computer Graphics Theory and Applications
294