before render at each triangle