optimize triangle render