20.10 Planar Reflection 937
// See comment (5) after source code.
reverse the culling direction;
// See comment (6) after source code.
draw node subtree with culling disabled;
restore the cull direction;
disable extra clip plane;
disable the postworld transformation;
// See comment (7) after source code.
enable alpha blending;
set blending color to (r,g,b,a) = (0,0,0,reflectance);
disallow alpha state changes;
render the plane;
allow alpha state changes;
disable alpha blending;
}
disable stencil buffering;
disable depth buffering;
draw the node subtree;
The steps of the pseudocode are as follows:
1. Render the reflecting plane into the stencil buffer. No pixels are written to the
depth buffer or color buffer, but we use depth buffer testing so that the stencil