added update functions and templated shader