change the logic of texture loading