optimize update of texture