Refactor triangle rendering.