How can I get a cylindrical texture?

Hi!
You can use two materials. One for side, the other one for caps (top, bottom).
https://jsfiddle.net/prisoner849/ns724xw3/