Refactored debug polygon rendering