Minor shader improvements

Incremental improvements to creating a shader source string in preparation for #1031.

CC @gbeatty