updated texturemapping code.