calculate texture repetitions