I sort of understand what he means, at what point did the chameleon start to adapt to have the ability it does
Contrary to popular opinion, the primary purpose of colour change in chameleons is actually social signalling. When you understand this it becomes much more obvious out it evolves. The animals that really do impressively match themselves to their surroundings are cuttlefish but, again, it appears to have first evolved as social signalling and only later been exapted for disguise.
To change into something visually it would have to have been observed, no? Then passed down, over many, many, many unfathomable generations until it was good enough to be of any use.
There's actually been quite a lot of work in this area. Remember that predators are generally not closely studying the moths they're flying around looking for food, only a small difference in visibility may mean the difference between getting spotted and not. In studies things that look very unlike their surroundings to our eyes have proven effective.