Implemented the same in Imp.WebGL.