
3.4 The Heart of the Renderer 197
Index 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Object X
0
AY
0
BCDY
1
EFZ
0
GHZ
1
X
1
I
DrawScene implements the traversal of the potentially visible set and passes sub-
sets of objects to the
Draw functions of the global effects. The incremental steps are
listed using pseudocode.
globalEffectStack = {};
startIndexStack = {};
globalEffectStack = {X}; // found X
0
, push
startIndexStack = {1}; // push first index scope X
finalIndex = 1; // last index scope X
globalEffectStack = {Y,X}; // found Y
0
, push
startIndexStack = {3,1}; // push first index scope Y
finalIndex = 3; // last index scope Y
finalIndex = 4; // last index scope Y
finalIndex =