solve issue #1172, fix updateCache not clearing the cached texture

solve #1172
this will clear the cached texture before render