Add some vars to shaders.

Edited yet again, another rewrite of another section, to add some vars
to shaders depending on what/where they are used.