seperated utility functions for shaders