this includes about half the work required to implement gl's halfz feature along with a fix for #4147 (closed)