stretch functions for webgl implementation