Fix shader uniform size
Improve legend rendering