<s>
Scanline	B-Algorithm
rendering	I-Algorithm
(	O
also	O
scan	B-Algorithm
line	I-Algorithm
rendering	I-Algorithm
and	O
scan-line	B-Algorithm
rendering	I-Algorithm
)	O
is	O
an	O
algorithm	O
for	O
visible	O
surface	O
determination	O
,	O
in	O
3D	O
computer	O
graphics	O
,	O
that	O
works	O
on	O
a	O
row-by-row	O
basis	O
rather	O
than	O
a	O
polygon-by-polygon	O
or	O
pixel-by-pixel	O
basis	O
.	O
</s>
<s>
All	O
of	O
the	O
polygons	B-General_Concept
to	O
be	O
rendered	O
are	O
first	O
sorted	O
by	O
the	O
top	O
y	O
coordinate	O
at	O
which	O
they	O
first	O
appear	O
,	O
then	O
each	O
row	O
or	O
scan	B-Algorithm
line	I-Algorithm
of	O
the	O
image	O
is	O
computed	O
using	O
the	O
intersection	O
of	O
a	O
scanline	B-Algorithm
with	O
the	O
polygons	B-General_Concept
on	O
the	O
front	O
of	O
the	O
sorted	O
list	O
,	O
while	O
the	O
sorted	O
list	O
is	O
updated	O
to	O
discard	O
no-longer-visible	O
polygons	B-General_Concept
as	O
the	O
active	O
scan	B-Algorithm
line	I-Algorithm
is	O
advanced	O
down	O
the	O
picture	O
.	O
</s>
<s>
Another	O
advantage	O
is	O
that	O
it	O
is	O
not	O
necessary	O
to	O
translate	O
the	O
coordinates	O
of	O
all	O
vertices	O
from	O
the	O
main	O
memory	O
into	O
the	O
working	O
memoryonly	O
vertices	O
defining	O
edges	O
that	O
intersect	O
the	O
current	O
scan	B-Algorithm
line	I-Algorithm
need	O
to	O
be	O
in	O
active	O
memory	O
,	O
and	O
each	O
vertex	O
is	O
read	O
in	O
only	O
once	O
.	O
</s>
<s>
The	O
main	O
memory	O
is	O
often	O
very	O
slow	O
compared	O
to	O
the	O
link	O
between	O
the	O
central	O
processing	O
unit	O
and	O
cache	B-General_Concept
memory	I-General_Concept
,	O
and	O
thus	O
avoiding	O
re-accessing	O
vertices	O
in	O
main	O
memory	O
can	O
provide	O
a	O
substantial	O
speedup	O
.	O
</s>
<s>
The	O
usual	O
method	O
starts	O
with	O
edges	O
of	O
projected	O
polygons	B-General_Concept
inserted	O
into	O
buckets	O
,	O
one	O
per	O
scanline	B-Algorithm
;	O
the	O
rasterizer	O
maintains	O
an	O
active	O
edge	O
table	O
(	O
AET	O
)	O
.	O
</s>
<s>
Entries	O
maintain	O
sort	O
links	O
,	O
X	O
coordinates	O
,	O
gradients	O
,	O
and	O
references	O
to	O
the	O
polygons	B-General_Concept
they	O
bound	O
.	O
</s>
<s>
To	O
rasterize	O
the	O
next	O
scanline	B-Algorithm
,	O
the	O
edges	O
no	O
longer	O
relevant	O
are	O
removed	O
;	O
new	O
edges	O
from	O
the	O
current	O
scanlines	B-Algorithm
 '	O
Y-bucket	O
are	O
added	O
,	O
inserted	O
sorted	O
by	O
X	O
coordinate	O
.	O
</s>
<s>
Active	O
edge	O
table	O
entries	O
are	O
maintained	O
in	O
an	O
X-sorted	O
list	O
by	O
bubble	B-Algorithm
sort	I-Algorithm
,	O
effecting	O
a	O
change	O
when	O
2	O
edges	O
cross	O
.	O
</s>
<s>
A	O
hybrid	O
between	O
this	O
and	O
Z-buffering	O
does	O
away	O
with	O
the	O
active	O
edge	O
table	O
sorting	O
,	O
and	O
instead	O
rasterizes	O
one	O
scanline	B-Algorithm
at	O
a	O
time	O
into	O
a	O
Z-buffer	O
,	O
maintaining	O
active	O
polygon	B-General_Concept
spans	O
from	O
one	O
scanline	B-Algorithm
to	O
the	O
next	O
.	O
</s>
<s>
In	O
another	O
variant	O
,	O
an	O
ID	O
buffer	O
is	O
rasterized	O
in	O
an	O
intermediate	O
step	O
,	O
allowing	O
deferred	O
shading	O
of	O
the	O
resulting	O
visible	O
pixels	B-Algorithm
.	O
</s>
<s>
The	O
first	O
publication	O
of	O
the	O
scanline	B-Algorithm
rendering	I-Algorithm
technique	O
was	O
probably	O
by	O
Wylie	O
,	O
Romney	O
,	O
Evans	O
,	O
and	O
Erdahl	O
in	O
1967	O
.	O
</s>
<s>
Other	O
early	O
developments	O
of	O
the	O
scanline	B-Algorithm
rendering	I-Algorithm
method	O
were	O
by	O
Bouknight	O
in	O
1969	O
,	O
and	O
Newell	O
,	O
Newell	O
,	O
and	O
Sancha	O
in	O
1972	O
.	O
</s>
<s>
The	O
early	O
Evans	O
&	O
Sutherland	O
ESIG	O
line	O
of	O
image-generators	O
(	O
IGs	O
)	O
employed	O
the	O
technique	O
in	O
hardware	O
'	O
on	O
the	O
fly	O
 '	O
,	O
to	O
generate	O
images	O
one	O
raster-line	O
at	O
a	O
time	O
without	O
a	O
framebuffer	B-Algorithm
,	O
saving	O
the	O
need	O
for	O
then	O
costly	O
memory	O
.	O
</s>
<s>
The	O
Nintendo	B-Device
DS	I-Device
is	O
the	O
latest	O
hardware	O
to	O
render	O
3D	O
scenes	O
in	O
this	O
manner	O
,	O
with	O
the	O
option	O
of	O
caching	B-General_Concept
the	O
rasterized	O
images	O
into	O
VRAM	O
.	O
</s>
<s>
The	O
sprite	O
hardware	O
prevalent	O
in	O
1980s	O
games	O
machines	O
can	O
be	O
considered	O
a	O
simple	O
2D	O
form	O
of	O
scanline	B-Algorithm
rendering	I-Algorithm
.	O
</s>
<s>
It	O
proved	O
better	O
than	O
Z-buffer/painter	O
'	O
s	O
type	O
algorithms	O
at	O
handling	O
scenes	O
of	O
high	O
depth	O
complexity	O
with	O
costly	O
pixel	B-Algorithm
operations	O
(	O
i.e.	O
</s>
<s>
Sony	O
experimented	O
with	O
software	O
scanline	B-Algorithm
renderers	O
on	O
a	O
second	O
Cell	B-General_Concept
processor	O
during	O
the	O
development	O
of	O
the	O
PlayStation	B-Operating_System
3	I-Operating_System
,	O
before	O
settling	O
on	O
a	O
conventional	O
CPU/GPU	O
arrangement	O
.	O
</s>
<s>
A	O
similar	O
principle	O
is	O
employed	O
in	O
tiled	O
rendering	O
(	O
most	O
famously	O
the	O
PowerVR	B-Device
3D	O
chip	O
)	O
;	O
that	O
is	O
,	O
primitives	O
are	O
sorted	O
into	O
screen	O
space	O
,	O
then	O
rendered	O
in	O
fast	O
on-chip	O
memory	O
,	O
one	O
tile	O
at	O
a	O
time	O
.	O
</s>
<s>
The	B-Operating_System
Dreamcast	I-Operating_System
provided	O
a	O
mode	O
for	O
rasterizing	O
one	O
row	O
of	O
tiles	O
at	O
a	O
time	O
for	O
direct	O
raster	O
scanout	O
,	O
saving	O
the	O
need	O
for	O
a	O
complete	O
framebuffer	B-Algorithm
,	O
somewhat	O
in	O
the	O
spirit	O
of	O
hardware	O
scanline	B-Algorithm
rendering	I-Algorithm
.	O
</s>
<s>
Some	O
software	O
rasterizers	O
use	O
'	O
span	O
buffering	O
 '	O
(	O
or	O
'	O
coverage	O
buffering	O
 '	O
)	O
,	O
in	O
which	O
a	O
list	O
of	O
sorted	O
,	O
clipped	O
spans	O
are	O
stored	O
in	O
scanline	B-Algorithm
buckets	O
.	O
</s>
<s>
Primitives	O
would	O
be	O
successively	O
added	O
to	O
this	O
datastructure	O
,	O
before	O
rasterizing	O
only	O
the	O
visible	O
pixels	B-Algorithm
in	O
a	O
final	O
stage	O
.	O
</s>
<s>
The	O
main	O
advantage	O
of	O
scanline	B-Algorithm
rendering	I-Algorithm
over	O
Z-buffering	O
is	O
that	O
the	O
number	O
of	O
times	O
visible	O
pixels	B-Algorithm
are	O
processed	O
is	O
kept	O
to	O
the	O
absolute	O
minimum	O
which	O
is	O
always	O
one	O
time	O
if	O
no	O
transparency	O
effects	O
are	O
used	O
—	O
a	O
benefit	O
for	O
the	O
case	O
of	O
high	O
resolution	O
or	O
expensive	O
shading	O
computations	O
.	O
</s>
<s>
In	O
modern	O
Z-buffer	O
systems	O
,	O
similar	O
benefits	O
can	O
be	O
gained	O
through	O
rough	O
front-to-back	O
sorting	O
(	O
approaching	O
the	O
'	O
reverse	O
painters	B-Algorithm
algorithm	I-Algorithm
 '	O
)	O
,	O
early	O
Z-reject	O
(	O
in	O
conjunction	O
with	O
hierarchical	O
Z	O
)	O
,	O
and	O
less	O
common	O
deferred	O
rendering	O
techniques	O
possible	O
on	O
programmable	O
GPUs	O
.	O
</s>
<s>
Scanline	B-Algorithm
techniques	O
working	O
on	O
the	O
raster	O
have	O
the	O
drawback	O
that	O
overload	O
is	O
not	O
handled	O
gracefully	O
.	O
</s>
<s>
Transformed	O
coordinates	O
,	O
attribute	O
gradients	O
,	O
etc.	O
,	O
need	O
never	O
leave	O
the	O
graphics	O
chip	O
;	O
only	O
the	O
visible	O
pixels	B-Algorithm
and	O
depth	O
values	O
are	O
stored	O
.	O
</s>
