Fix bugs for general polygon texture mapping