What factors affect which shader language to learn? I don't know any shader languages. I've heard of GLSL and HLSL, and I'm interested in learning one or both.

Are there significant differences between them that would make one or other better in certain situations? Is it useful to know both or would either cover most needs?

I don't want vague answers indicating personal preference. I'm looking for specific measurable differences so that I can decide for myself which will suit me best. I don't have a specific task in mind - I'm hoping to discover whether there is one or other that I can learn and then apply to any future tasks, rather than having to learn a new language for each new task.

If there are other shader languages which I have not mentioned I would be interested to hear the comparison for those too, provided they are not dependent on any particular GPU manufacturer. I want my code to be portable across different graphics cards.
The shader language is bound to the APIs/engines that support it (glsl to openGL &amp; WebGL and hlsl to D3D). There are tools to translate from one to the other but they aren't perfect.

This means the main reason to pick one over the other is which platform you will be working on.

However by the end of the year a new binary shader representation will come out called Spir-V designed for Vulkan and an OpenGL extension for it is expected to follow shortly. This will allow you to write shaders in many languages as long as a translation tool to Spir-V exists (several are in the works including a Python and Haskell tool).