Pulling out some shader creation code to be more generic