fixed texturing bug
simplified computation for quadratic shapes