fix a bug of generating texture object