<s>
A	O
lightmap	B-Data_Structure
is	O
a	O
data	B-General_Concept
structure	I-General_Concept
used	O
in	O
lightmapping	O
,	O
a	O
form	O
of	O
surface	O
caching	O
in	O
which	O
the	O
brightness	O
of	O
surfaces	O
in	O
a	O
virtual	O
scene	O
is	O
pre-calculated	O
and	O
stored	O
in	O
texture	O
maps	O
for	O
later	O
use	O
.	O
</s>
<s>
Lightmaps	B-Data_Structure
are	O
most	O
commonly	O
applied	O
to	O
static	O
objects	O
in	O
applications	O
that	O
use	O
real-time	B-General_Concept
3D	O
computer	O
graphics	O
,	O
such	O
as	O
video	O
games	O
,	O
in	O
order	O
to	O
provide	O
lighting	O
effects	O
such	O
as	O
global	B-Algorithm
illumination	I-Algorithm
at	O
a	O
relatively	O
low	O
computational	O
cost	O
.	O
</s>
<s>
John	O
Carmack	O
's	O
Quake	B-Application
was	O
the	O
first	O
computer	O
game	O
to	O
use	O
lightmaps	B-Data_Structure
to	O
augment	O
rendering	B-Algorithm
.	O
</s>
<s>
Before	O
lightmaps	B-Data_Structure
were	O
invented	O
,	O
realtime	O
applications	O
relied	O
purely	O
on	O
Gouraud	B-Algorithm
shading	I-Algorithm
to	O
interpolate	O
vertex	O
lighting	O
for	O
surfaces	O
.	O
</s>
<s>
This	O
only	O
allowed	O
low	O
frequency	O
lighting	O
information	O
,	O
and	O
could	O
create	O
clipping	B-Algorithm
artifacts	O
close	O
to	O
the	O
camera	O
without	O
perspective-correct	O
interpolation	O
.	O
</s>
<s>
Discontinuity	O
meshing	O
was	O
sometimes	O
used	O
especially	O
with	O
radiosity	O
solutions	O
to	O
adaptively	O
improve	O
the	O
resolution	B-Algorithm
of	O
vertex	O
lighting	O
information	O
,	O
however	O
the	O
additional	O
cost	O
in	O
primitive	O
setup	O
for	O
realtime	O
rasterization	O
was	O
generally	O
prohibitive	O
.	O
</s>
<s>
Quake	B-Application
's	O
software	O
rasterizer	O
used	O
surface	O
caching	O
to	O
apply	O
lighting	O
calculations	O
in	O
texture	O
space	O
once	O
when	O
polygons	O
initially	O
appear	O
within	O
the	O
viewing	B-General_Concept
frustum	I-General_Concept
(	O
effectively	O
creating	O
temporary	O
'	O
lit	O
 '	O
versions	O
of	O
the	O
currently	O
visible	O
textures	O
as	O
the	O
viewer	O
negotiated	O
the	O
scene	O
)	O
.	O
</s>
<s>
Lightmaps	B-Data_Structure
are	O
composed	O
of	O
lumels	O
(	O
lumination	O
elements	O
)	O
,	O
analogous	O
to	O
texels	O
in	O
texture	O
mapping	O
.	O
</s>
<s>
Smaller	O
lumels	O
yield	O
a	O
higher	O
resolution	B-Algorithm
lightmap	B-Data_Structure
,	O
providing	O
finer	O
lighting	O
detail	O
at	O
the	O
price	O
of	O
reduced	O
performance	O
and	O
increased	O
memory	O
usage	O
.	O
</s>
<s>
For	O
example	O
,	O
a	O
lightmap	B-Data_Structure
scale	O
of	O
4	O
lumels	O
per	O
world	O
unit	O
would	O
give	O
a	O
lower	O
quality	O
than	O
a	O
scale	O
of	O
16	O
lumels	O
per	O
world	O
unit	O
.	O
</s>
<s>
Thus	O
,	O
in	O
using	O
the	O
technique	O
,	O
level	O
designers	O
and	O
3d	O
artists	O
often	O
have	O
to	O
make	O
a	O
compromise	O
between	O
performance	O
and	O
quality	O
;	O
if	O
high	B-Algorithm
resolution	I-Algorithm
lightmaps	B-Data_Structure
are	O
used	O
too	O
frequently	O
then	O
the	O
application	O
may	O
consume	O
excessive	O
system	O
resources	O
,	O
negatively	O
affecting	O
performance	O
.	O
</s>
<s>
Lightmap	B-Data_Structure
resolution	B-Algorithm
and	O
scaling	O
may	O
also	O
be	O
limited	O
by	O
the	O
amount	O
of	O
disk	O
storage	O
space	O
,	O
bandwidth/download	O
time	O
,	O
or	O
texture	O
memory	O
available	O
to	O
the	O
application	O
.	O
</s>
<s>
Some	O
implementations	O
attempt	O
to	O
pack	O
multiple	O
lightmaps	B-Data_Structure
together	O
in	O
a	O
process	O
known	O
as	O
atlasing	O
to	O
help	O
circumvent	O
these	O
limitations	O
.	O
</s>
<s>
Lightmap	B-Data_Structure
resolution	B-Algorithm
and	O
scale	O
are	O
two	O
different	O
things	O
.	O
</s>
<s>
The	O
resolution	B-Algorithm
is	O
the	O
area	O
,	O
in	O
pixels	O
,	O
available	O
for	O
storing	O
one	O
or	O
more	O
surface	O
's	O
lightmaps	B-Data_Structure
.	O
</s>
<s>
The	O
number	O
of	O
individual	O
surfaces	O
that	O
can	O
fit	O
on	O
a	O
lightmap	B-Data_Structure
is	O
determined	O
by	O
the	O
scale	O
.	O
</s>
<s>
Lower	O
scale	O
values	O
mean	O
higher	O
quality	O
and	O
more	O
space	O
taken	O
on	O
a	O
lightmap	B-Data_Structure
.	O
</s>
<s>
A	O
surface	O
can	O
have	O
a	O
lightmap	B-Data_Structure
that	O
has	O
the	O
same	O
area	O
,	O
so	O
a	O
1:1	O
ratio	O
,	O
or	O
smaller	O
,	O
so	O
the	O
lightmap	B-Data_Structure
is	O
stretched	O
to	O
fit	O
.	O
</s>
<s>
Lightmaps	B-Data_Structure
in	O
games	O
are	O
usually	O
colored	O
texture	O
maps	O
,	O
or	O
per	O
vertex	O
colors	O
.	O
</s>
<s>
They	O
are	O
usually	O
flat	O
,	O
without	O
information	O
about	O
the	O
light	O
's	O
direction	O
,	O
whilst	O
some	O
game	O
engines	O
use	O
multiple	O
lightmaps	B-Data_Structure
to	O
provide	O
approximate	O
directional	O
information	O
to	O
combine	O
with	O
normal-maps	O
.	O
</s>
<s>
Lightmaps	B-Data_Structure
may	O
also	O
store	O
separate	O
precalculated	O
components	O
of	O
lighting	O
information	O
for	O
semi-dynamic	O
lighting	O
with	O
shaders	O
,	O
such	O
as	O
ambient-occlusion	O
&	O
sunlight	O
shadowing	O
.	O
</s>
<s>
When	O
creating	O
lightmaps	B-Data_Structure
,	O
any	O
lighting	O
model	O
may	O
be	O
used	O
,	O
because	O
the	O
lighting	O
is	O
entirely	O
precomputed	O
and	O
real-time	B-General_Concept
performance	O
is	O
not	O
always	O
a	O
necessity	O
.	O
</s>
<s>
Modern	O
3D	O
packages	O
include	O
specific	O
plugins	O
for	O
applying	O
light-map	O
UV-coordinates	O
,	O
atlas-ing	O
multiple	O
surfaces	O
into	O
single	O
texture	O
sheets	O
,	O
and	O
rendering	B-Algorithm
the	O
maps	O
themselves	O
.	O
</s>
<s>
Alternatively	O
game	O
engine	O
pipelines	O
may	O
include	O
custom	O
lightmap	B-Data_Structure
creation	O
tools	O
.	O
</s>
<s>
In	O
all	O
cases	O
,	O
soft	O
shadows	O
for	O
static	O
geometry	O
are	O
possible	O
if	O
simple	O
occlusion	O
tests	O
(	O
such	O
as	O
basic	O
ray-tracing	B-Algorithm
)	O
are	O
used	O
to	O
determine	O
which	O
lumels	O
are	O
visible	O
to	O
the	O
light	O
.	O
</s>
<s>
However	O
,	O
the	O
actual	O
softness	O
of	O
the	O
shadows	O
is	O
determined	O
by	O
how	O
the	O
engine	O
interpolates	O
the	O
lumel	O
data	O
across	O
a	O
surface	O
,	O
and	O
can	O
result	O
in	O
a	O
pixelated	B-Algorithm
look	O
if	O
the	O
lumels	O
are	O
too	O
large	O
.	O
</s>
<s>
Lightmaps	B-Data_Structure
can	O
also	O
be	O
calculated	O
in	O
real-time	B-General_Concept
for	O
good	O
quality	O
colored	O
lighting	O
effects	O
that	O
are	O
not	O
prone	O
to	O
the	O
defects	O
of	O
Gouraud	B-Algorithm
shading	I-Algorithm
,	O
although	O
shadow	O
creation	O
must	O
still	O
be	O
done	O
using	O
another	O
method	O
such	O
as	O
stencil	O
shadow	O
volumes	O
or	O
shadow	O
mapping	O
,	O
as	O
real-time	B-General_Concept
ray-tracing	B-Algorithm
is	O
still	O
too	O
slow	O
to	O
perform	O
on	O
modern	O
hardware	O
in	O
most	O
3D	O
engines	O
.	O
</s>
<s>
Photon	B-Application
mapping	I-Application
can	O
be	O
used	O
to	O
calculate	O
global	B-Algorithm
illumination	I-Algorithm
for	O
light	B-Data_Structure
maps	I-Data_Structure
.	O
</s>
<s>
vertex	O
color	O
values	O
stored	O
for	O
high	O
detail	O
meshes	O
,	O
whilst	O
light	B-Data_Structure
maps	I-Data_Structure
are	O
only	O
used	O
for	O
coarser	O
geometry	O
.	O
</s>
<s>
In	O
discontinuity	O
mapping	O
,	O
the	O
scene	O
may	O
be	O
further	O
subdivided	O
and	O
clipped	B-Algorithm
along	O
major	O
changes	O
in	O
light	O
and	O
dark	O
to	O
better	O
define	O
shadows	O
.	O
</s>
